From 02a7205b074eae6d6606a0c6aa27b054a73b2723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Mon, 8 Apr 2019 21:10:48 +0200 Subject: [PATCH 01/52] Bump to commit e1ca3b4434945e57e8e3a451cdbde74a903cc8e1 Add new goipath Updated patches Updated man pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- .gitignore | 2 + 0001-hack-etcdmain-to-generate-etcd.1.patch | 124 ++++++------- 0001-hack-to-generate-man-pages.patch | 79 ++++---- ...ba0e0d4ab628cb13ffd76da47dbea357d0a6.patch | 23 --- Fix-format-errors.patch | 34 ---- etcd.spec | 173 ++++++++++-------- etcdctl.1 | 25 --- ...d-max-snapshots-and-max-wals-to-help.patch | 41 ----- genmanpages.sh | 2 +- hack-test.patch | 73 -------- run-etcd-on-ppc64le-by-default.patch | 31 ---- sources | 4 +- 12 files changed, 190 insertions(+), 421 deletions(-) delete mode 100644 1136ba0e0d4ab628cb13ffd76da47dbea357d0a6.patch delete mode 100644 Fix-format-errors.patch delete mode 100644 etcdctl.1 delete mode 100644 etcdmain-Add-max-snapshots-and-max-wals-to-help.patch delete mode 100644 hack-test.patch delete mode 100644 run-etcd-on-ppc64le-by-default.patch diff --git a/.gitignore b/.gitignore index 7c97261..e20e7e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /etcd-3.2.16.tar.gz /man-3.2.16.tar.gz +/etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1.tar.gz +/man-3.3.12.tar.gz diff --git a/0001-hack-etcdmain-to-generate-etcd.1.patch b/0001-hack-etcdmain-to-generate-etcd.1.patch index b085093..4476430 100644 --- a/0001-hack-etcdmain-to-generate-etcd.1.patch +++ b/0001-hack-etcdmain-to-generate-etcd.1.patch @@ -1,26 +1,14 @@ -From 81519130b0abec199ddc9e3559e64884742b1bf5 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Tue, 7 Nov 2017 14:04:01 +0100 -Subject: [PATCH] hack etcdmain to generate etcd.1 - ---- - etcdmain/config.go | 25 ++++---- - etcdmain/fake_flagset.go | 157 +++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 171 insertions(+), 11 deletions(-) - create mode 100644 etcdmain/fake_flagset.go - -diff --git a/etcdmain/config.go b/etcdmain/config.go -index b873220..4770334 100644 ---- a/etcdmain/config.go -+++ b/etcdmain/config.go -@@ -118,14 +118,14 @@ func newConfig() *config { +diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go +--- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 2019-03-14 20:11:28.569755622 +0100 ++++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go 2019-03-14 20:23:17.601851367 +0100 +@@ -122,14 +122,14 @@ func newConfig() *config { ), } -- fs := cfg.FlagSet +- fs := cfg.cf.flagSet - fs.Usage = func() { -+ fs := InitFlagSet(cfg.FlagSet) -+ cfg.FlagSet.Usage = func() { ++ fs := InitFlagSet(cfg.cf.flagSet) ++ cfg.cf.flagSet.Usage = func() { fmt.Fprintln(os.Stderr, usageline) } @@ -28,78 +16,91 @@ index b873220..4770334 100644 - // member + fs.AddGroup("member") - fs.Var(cfg.CorsInfo, "cors", "Comma-separated white list of origins for CORS (cross-origin resource sharing).") - fs.StringVar(&cfg.Dir, "data-dir", cfg.Dir, "Path to the data directory.") - fs.StringVar(&cfg.WalDir, "wal-dir", cfg.WalDir, "Path to the dedicated wal directory.") -@@ -139,7 +139,7 @@ func newConfig() *config { - fs.UintVar(&cfg.ElectionMs, "election-timeout", cfg.ElectionMs, "Time (in milliseconds) for an election to timeout.") - fs.Int64Var(&cfg.QuotaBackendBytes, "quota-backend-bytes", cfg.QuotaBackendBytes, "Raise alarms when backend size exceeds the given quota. 0 means use the default quota.") + fs.StringVar(&cfg.ec.Dir, "data-dir", cfg.ec.Dir, "Path to the data directory.") + fs.StringVar(&cfg.ec.WalDir, "wal-dir", cfg.ec.WalDir, "Path to the dedicated wal directory.") + fs.Var( +@@ -162,7 +162,7 @@ func newConfig() *config { + fs.DurationVar(&cfg.ec.GRPCKeepAliveInterval, "grpc-keepalive-interval", cfg.ec.GRPCKeepAliveInterval, "Frequency duration of server-to-client ping to check if a connection is alive (0 to disable).") + fs.DurationVar(&cfg.ec.GRPCKeepAliveTimeout, "grpc-keepalive-timeout", cfg.ec.GRPCKeepAliveTimeout, "Additional duration of wait before closing a non-responsive connection (0 to disable).") - // clustering + fs.AddGroup("clustering") - fs.Var(flags.NewURLsValue(embed.DefaultInitialAdvertisePeerURLs), "initial-advertise-peer-urls", "List of this member's peer URLs to advertise to the rest of the cluster.") - fs.Var(flags.NewURLsValue(embed.DefaultAdvertiseClientURLs), "advertise-client-urls", "List of this member's client URLs to advertise to the public.") - fs.StringVar(&cfg.Durl, "discovery", cfg.Durl, "Discovery URL used to bootstrap the cluster.") -@@ -160,7 +160,7 @@ func newConfig() *config { - fs.BoolVar(&cfg.StrictReconfigCheck, "strict-reconfig-check", cfg.StrictReconfigCheck, "Reject reconfiguration requests that would cause quorum loss.") - fs.BoolVar(&cfg.EnableV2, "enable-v2", true, "Accept etcd V2 client requests.") + fs.Var( + flags.NewUniqueURLsWithExceptions(embed.DefaultInitialAdvertisePeerURLs, ""), + "initial-advertise-peer-urls", +@@ -187,7 +187,7 @@ func newConfig() *config { + fs.BoolVar(&cfg.ec.EnableV2, "enable-v2", cfg.ec.EnableV2, "Accept etcd V2 client requests.") + fs.BoolVar(&cfg.ec.PreVote, "pre-vote", cfg.ec.PreVote, "Enable to run an additional Raft election phase.") - // proxy + fs.AddGroup("proxy") - fs.Var(cfg.proxy, "proxy", fmt.Sprintf("Valid values include %s", strings.Join(cfg.proxy.Values, ", "))) - if err := cfg.proxy.Set(proxyFlagOff); err != nil { - // Should never happen. -@@ -172,7 +172,7 @@ func newConfig() *config { - fs.UintVar(&cfg.ProxyWriteTimeoutMs, "proxy-write-timeout", cfg.ProxyWriteTimeoutMs, "Time (in milliseconds) for a write to timeout.") - fs.UintVar(&cfg.ProxyReadTimeoutMs, "proxy-read-timeout", cfg.ProxyReadTimeoutMs, "Time (in milliseconds) for a read to timeout.") + fs.Var(cfg.cf.proxy, "proxy", fmt.Sprintf("Valid values include %q", cfg.cf.proxy.Valids())) + fs.UintVar(&cfg.cp.ProxyFailureWaitMs, "proxy-failure-wait", cfg.cp.ProxyFailureWaitMs, "Time (in milliseconds) an endpoint will be held in a failed state.") + fs.UintVar(&cfg.cp.ProxyRefreshIntervalMs, "proxy-refresh-interval", cfg.cp.ProxyRefreshIntervalMs, "Time (in milliseconds) of the endpoints refresh interval.") +@@ -195,7 +195,7 @@ func newConfig() *config { + fs.UintVar(&cfg.cp.ProxyWriteTimeoutMs, "proxy-write-timeout", cfg.cp.ProxyWriteTimeoutMs, "Time (in milliseconds) for a write to timeout.") + fs.UintVar(&cfg.cp.ProxyReadTimeoutMs, "proxy-read-timeout", cfg.cp.ProxyReadTimeoutMs, "Time (in milliseconds) for a read to timeout.") - // security + fs.AddGroup("security") - fs.StringVar(&cfg.ClientTLSInfo.CAFile, "ca-file", "", "DEPRECATED: Path to the client server TLS CA file.") - fs.StringVar(&cfg.ClientTLSInfo.CertFile, "cert-file", "", "Path to the client server TLS cert file.") - fs.StringVar(&cfg.ClientTLSInfo.KeyFile, "key-file", "", "Path to the client server TLS key file.") -@@ -186,28 +186,31 @@ func newConfig() *config { - fs.StringVar(&cfg.PeerTLSInfo.TrustedCAFile, "peer-trusted-ca-file", "", "Path to the peer server TLS trusted CA file.") - fs.BoolVar(&cfg.PeerAutoTLS, "peer-auto-tls", false, "Peer TLS using generated certificates") + fs.StringVar(&cfg.ec.ClientTLSInfo.CertFile, "cert-file", "", "Path to the client server TLS cert file.") + fs.StringVar(&cfg.ec.ClientTLSInfo.KeyFile, "key-file", "", "Path to the client server TLS key file.") + fs.BoolVar(&cfg.ec.ClientTLSInfo.ClientCertAuth, "client-cert-auth", false, "Enable client cert authentication.") +@@ -218,41 +218,44 @@ func newConfig() *config { + ) + fs.Var(flags.NewUniqueStringsValue("*"), "host-whitelist", "Comma-separated acceptable hostnames from HTTP client requests, if server is not secure (empty means allow all).") - // logging + fs.AddGroup("logging") - fs.BoolVar(&cfg.Debug, "debug", false, "Enable debug-level logging for etcd.") - fs.StringVar(&cfg.LogPkgLevels, "log-package-levels", "", "Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG').") - fs.StringVar(&cfg.logOutput, "log-output", "default", "Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.") - -- // unsafe -+ fs.AddGroup("unsafe") - fs.BoolVar(&cfg.ForceNewCluster, "force-new-cluster", false, "Force to create a new one member cluster.") + fs.StringVar(&cfg.ec.Logger, "logger", "capnslog", "Specify 'zap' for structured logging or 'capnslog'.") + fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-output", "DEPRECATED: use '--log-outputs'.") + fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-outputs", "Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd, or list of comma separated output targets.") + fs.BoolVar(&cfg.ec.Debug, "debug", false, "Enable debug-level logging for etcd.") + fs.StringVar(&cfg.ec.LogPkgLevels, "log-package-levels", "", "(To be deprecated) Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG').") - // version + fs.AddGroup("version") fs.BoolVar(&cfg.printVersion, "version", false, "Print the version and exit.") - fs.IntVar(&cfg.AutoCompactionRetention, "auto-compaction-retention", 0, "Auto compaction retention for mvcc key value store in hour. 0 means disable auto compaction.") + fs.StringVar(&cfg.ec.AutoCompactionRetention, "auto-compaction-retention", "0", "Auto compaction retention for mvcc key value store. 0 means disable auto compaction.") + fs.StringVar(&cfg.ec.AutoCompactionMode, "auto-compaction-mode", "periodic", "interpret 'auto-compaction-retention' one of: periodic|revision. 'periodic' for duration based retention, defaulting to hours if no time unit is provided (e.g. '5m'). 'revision' for revision number based retention.") - // pprof profiler via HTTP + fs.AddGroup("profiling") - fs.BoolVar(&cfg.EnablePprof, "enable-pprof", false, "Enable runtime profiling data via HTTP server. Address is at client URL + \"/debug/pprof/\"") + fs.BoolVar(&cfg.ec.EnablePprof, "enable-pprof", false, "Enable runtime profiling data via HTTP server. Address is at client URL + \"/debug/pprof/\"") // additional metrics - fs.StringVar(&cfg.Metrics, "metrics", cfg.Metrics, "Set level of detail for exported metrics, specify 'extensive' to include histogram metrics") + fs.StringVar(&cfg.ec.Metrics, "metrics", cfg.ec.Metrics, "Set level of detail for exported metrics, specify 'extensive' to include histogram metrics") - // auth + fs.AddGroup("auth") - fs.StringVar(&cfg.AuthToken, "auth-token", cfg.AuthToken, "Specify auth token specific options.") + fs.StringVar(&cfg.ec.AuthToken, "auth-token", cfg.ec.AuthToken, "Specify auth token specific options.") + fs.UintVar(&cfg.ec.BcryptCost, "bcrypt-cost", cfg.ec.BcryptCost, "Specify bcrypt algorithm cost factor for auth password hashing.") + +- // gateway ++ fs.AddGroup("gateway") + fs.BoolVar(&cfg.ec.EnableGRPCGateway, "enable-grpc-gateway", true, "Enable GRPC gateway.") + +- // experimental ++ fs.AddGroup("experimental") + fs.BoolVar(&cfg.ec.ExperimentalInitialCorruptCheck, "experimental-initial-corrupt-check", cfg.ec.ExperimentalInitialCorruptCheck, "Enable to check data corruption before serving any client/peer traffic.") + fs.DurationVar(&cfg.ec.ExperimentalCorruptCheckTime, "experimental-corrupt-check-time", cfg.ec.ExperimentalCorruptCheckTime, "Duration of time between cluster corruption check passes.") + fs.StringVar(&cfg.ec.ExperimentalEnableV2V3, "experimental-enable-v2v3", cfg.ec.ExperimentalEnableV2V3, "v3 prefix for serving emulated v2 state.") + fs.StringVar(&cfg.ec.ExperimentalBackendFreelistType, "experimental-backend-bbolt-freelist-type", cfg.ec.ExperimentalBackendFreelistType, "ExperimentalBackendFreelistType specifies the type of freelist that boltdb backend uses(array and map are supported types)") + +- // unsafe ++ fs.AddGroup("unsafe") + fs.BoolVar(&cfg.ec.ForceNewCluster, "force-new-cluster", false, "Force to create a new one member cluster.") + fs.GenMan() + os.Exit(0) -+ ++ // ignored for _, f := range cfg.ignored { fs.Var(&flags.IgnoredFlag{Name: f}, f, "") -diff --git a/etcdmain/fake_flagset.go b/etcdmain/fake_flagset.go -new file mode 100644 -index 0000000..71f230b ---- /dev/null -+++ b/etcdmain/fake_flagset.go +diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go.hack1 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go +--- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go.hack1 2019-03-14 20:11:28.570755620 +0100 ++++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go 2019-03-14 20:11:28.570755620 +0100 @@ -0,0 +1,157 @@ +package etcdmain + @@ -258,6 +259,3 @@ index 0000000..71f230b + } + fmt.Printf(".SH SEE ALSO:\n\\fBetcdctl(1)\\fP, \\fBetcdctl2(1)\\fP, \\fBetcdctl3(1)\\fP\n\n") +} --- -2.7.5 - diff --git a/0001-hack-to-generate-man-pages.patch b/0001-hack-to-generate-man-pages.patch index cd4dac4..b77a849 100644 --- a/0001-hack-to-generate-man-pages.patch +++ b/0001-hack-to-generate-man-pages.patch @@ -1,43 +1,9 @@ -From 481e731c01426bd7488011352515db03a46aa280 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Mon, 6 Nov 2017 23:05:19 +0100 -Subject: [PATCH] hack-to-generate-man-pages - ---- - .../_workspace/src/github.com/urfave/cli/flag.go | 4 +- - etcdctl/ctlv2/ctl.go | 62 ++++++++++++++++++++++ - etcdctl/ctlv3/ctl_nocov.go | 13 +++-- - 3 files changed, 74 insertions(+), 5 deletions(-) - -diff --git a/Godeps/_workspace/src/github.com/urfave/cli/flag.go b/Godeps/_workspace/src/github.com/urfave/cli/flag.go -index f8a28d1..9787fe1 100644 ---- a/Godeps/_workspace/src/github.com/urfave/cli/flag.go -+++ b/Godeps/_workspace/src/github.com/urfave/cli/flag.go -@@ -752,7 +752,7 @@ func prefixedNames(fullName, placeholder string) string { - parts := strings.Split(fullName, ",") - for i, name := range parts { - name = strings.Trim(name, " ") -- prefixed += prefixFor(name) + name -+ prefixed += "\\fB" + prefixFor(name) + name + "\\fP" - if placeholder != "" { - prefixed += " " + placeholder - } -@@ -828,7 +828,7 @@ func stringifyFlag(f Flag) string { - usageWithDefault := strings.TrimSpace(fmt.Sprintf("%s%s", usage, defaultValueString)) - - return withEnvHint(fv.FieldByName("EnvVar").String(), -- fmt.Sprintf("%s\t%s", prefixedNames(fv.FieldByName("Name").String(), placeholder), usageWithDefault)) -+ fmt.Sprintf("%s\n\t\t\t%s", prefixedNames(fv.FieldByName("Name").String(), placeholder), usageWithDefault)) - } - - func stringifyIntSliceFlag(f IntSliceFlag) string { -diff --git a/etcdctl/ctlv2/ctl.go b/etcdctl/ctlv2/ctl.go -index e949b06..eb5170a 100644 ---- a/etcdctl/ctlv2/ctl.go -+++ b/etcdctl/ctlv2/ctl.go -@@ -42,6 +42,68 @@ func Start(apiv string) { - " Set environment variable ETCDCTL_API=3 to use v3 API or ETCDCTL_API=2 to use v2 API." +diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go.hack2 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go +--- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go.hack2 2019-03-12 20:09:09.000000000 +0100 ++++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go 2019-03-14 20:20:04.887079104 +0100 +@@ -36,6 +36,68 @@ func Start() { } + app.Usage = "A simple command line client for etcd." + cli.AppHelpTemplate = `.TH "ETCD" "1" " etcd User Manuals" "Etcd contributors" "Nov 2017" "" +.SH NAME: @@ -104,17 +70,16 @@ index e949b06..eb5170a 100644 app.Flags = []cli.Flag{ cli.BoolFlag{Name: "debug", Usage: "output cURL commands which can be used to reproduce the request"}, cli.BoolFlag{Name: "no-sync", Usage: "don't synchronize cluster information before sending request"}, -diff --git a/etcdctl/ctlv3/ctl_nocov.go b/etcdctl/ctlv3/ctl_nocov.go -index 52751fe..e3089cf 100644 ---- a/etcdctl/ctlv3/ctl_nocov.go -+++ b/etcdctl/ctlv3/ctl_nocov.go +diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go.hack2 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go +--- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go.hack2 2019-03-14 20:20:04.888079103 +0100 ++++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go 2019-03-14 20:32:35.376178988 +0100 @@ -16,13 +16,20 @@ package ctlv3 --import "github.com/coreos/etcd/etcdctl/ctlv3/command" +-import "go.etcd.io/etcd/etcdctl/ctlv3/command" +//import "github.com/coreos/etcd/etcdctl/ctlv3/command" -+import "github.com/spf13/cobra" ++import cobra "github.com/spf13/cobra/doc" func Start() { rootCmd.SetUsageFunc(usageFunc) @@ -132,6 +97,24 @@ index 52751fe..e3089cf 100644 + + cobra.GenManTree(rootCmd, header, "") } --- -2.7.5 - +diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go.hack2 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go +--- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go.hack2 2019-03-12 20:09:09.000000000 +0100 ++++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go 2019-03-14 20:20:04.883079109 +0100 +@@ -670,7 +670,7 @@ func prefixedNames(fullName, placeholder + parts := strings.Split(fullName, ",") + for i, name := range parts { + name = strings.Trim(name, " ") +- prefixed += prefixFor(name) + name ++ prefixed += "\\fB" + prefixFor(name) + name + "\\fP" + if placeholder != "" { + prefixed += " " + placeholder + } +@@ -745,7 +745,7 @@ func stringifyFlag(f Flag) string { + usageWithDefault := strings.TrimSpace(fmt.Sprintf("%s%s", usage, defaultValueString)) + + return withEnvHint(fv.FieldByName("EnvVar").String(), +- fmt.Sprintf("%s\t%s", prefixedNames(fv.FieldByName("Name").String(), placeholder), usageWithDefault)) ++ fmt.Sprintf("%s\n\t\t\t%s", prefixedNames(fv.FieldByName("Name").String(), placeholder), usageWithDefault)) + } + + func stringifyIntSliceFlag(f IntSliceFlag) string { diff --git a/1136ba0e0d4ab628cb13ffd76da47dbea357d0a6.patch b/1136ba0e0d4ab628cb13ffd76da47dbea357d0a6.patch deleted file mode 100644 index 9066984..0000000 --- a/1136ba0e0d4ab628cb13ffd76da47dbea357d0a6.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 1136ba0e0d4ab628cb13ffd76da47dbea357d0a6 Mon Sep 17 00:00:00 2001 -From: Gyuho Lee -Date: Fri, 15 Jun 2018 10:36:17 -0700 -Subject: [PATCH] raft: fix logger variadic parameter - -Signed-off-by: Gyuho Lee ---- - raft/logger.go | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/raft/logger.go b/raft/logger.go -index 92e55b373e..426a77d344 100644 ---- a/raft/logger.go -+++ b/raft/logger.go -@@ -114,7 +114,7 @@ func (l *DefaultLogger) Fatalf(format string, v ...interface{}) { - } - - func (l *DefaultLogger) Panic(v ...interface{}) { -- l.Logger.Panic(v) -+ l.Logger.Panic(v...) - } - - func (l *DefaultLogger) Panicf(format string, v ...interface{}) { diff --git a/Fix-format-errors.patch b/Fix-format-errors.patch deleted file mode 100644 index 5907294..0000000 --- a/Fix-format-errors.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 89901423d929b66240231196616688cddb39b115 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Fri, 9 Mar 2018 17:13:26 +0100 -Subject: [PATCH] Fix format errors - ---- - pkg/pbutil/pbutil_test.go | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pkg/pbutil/pbutil_test.go b/pkg/pbutil/pbutil_test.go -index fd361ec..21b1870 100644 ---- a/pkg/pbutil/pbutil_test.go -+++ b/pkg/pbutil/pbutil_test.go -@@ -24,7 +24,7 @@ func TestMarshaler(t *testing.T) { - data := []byte("test data") - m := &fakeMarshaler{data: data} - if g := MustMarshal(m); !reflect.DeepEqual(g, data) { -- t.Errorf("data = %s, want %s", g, m) -+ t.Errorf("data = %s, want #%v", g, m) - } - } - -@@ -43,7 +43,7 @@ func TestUnmarshaler(t *testing.T) { - m := &fakeUnmarshaler{} - MustUnmarshal(m, data) - if !reflect.DeepEqual(m.data, data) { -- t.Errorf("data = %s, want %s", m.data, m) -+ t.Errorf("data = %s, want #%v", m.data, m) - } - } - --- -2.7.5 - diff --git a/etcd.spec b/etcd.spec index 1299e8c..f1d248e 100644 --- a/etcd.spec +++ b/etcd.spec @@ -1,39 +1,45 @@ -# http://github.com/coreos/etcd -%global goipath github.com/coreos/etcd -Version: 3.2.16 +# https://github.com/coreos/etcd +%global goipath go.etcd.io/etcd +%global forgeurl https://github.com/coreos/etcd +%global oldgoipath github.com/coreos/etcd +%global oldgoname %gorpmname %{oldgoipath} +%global commit e1ca3b4434945e57e8e3a451cdbde74a903cc8e1 %gometa -%global man_version 3.2.16 +%global man_version 3.3.12 Name: etcd -Release: 6%{?dist} -Summary: A highly-available key value store for shared configuration -License: ASL 2.0 +Version: 3.3.12 +Release: 1%{?dist} +Summary: A highly-available key value store for shared configuration +License: ASL 2.0 URL: %{gourl} Source0: %{gosource} -Source1: %{name}.service -Source2: %{name}.conf +Source1: %{name}.service +Source2: %{name}.conf Source3: man-%{man_version}.tar.gz - -Patch0: Fix-format-errors.patch -Patch1: https://github.com/etcd-io/etcd/commit/1136ba0e0d4ab628cb13ffd76da47dbea357d0a6.patch +# sh genmanpages.sh path_to_built_source +Source10: genmanpages.sh +# Not patches to apply here, but used on the source to generate man pages +Source11: 0001-hack-etcdmain-to-generate-etcd.1.patch +Source12: 0001-hack-to-generate-man-pages.patch BuildRequires: golang(github.com/bgentry/speakeasy) -BuildRequires: golang(github.com/boltdb/bolt) -BuildRequires: golang(github.com/cheggaaa/pb) -BuildRequires: golang(github.com/cockroachdb/cmux) BuildRequires: golang(github.com/coreos/go-semver/semver) BuildRequires: golang(github.com/coreos/go-systemd/daemon) -BuildRequires: golang(github.com/coreos/go-systemd/util) +BuildRequires: golang(github.com/coreos/go-systemd/journal) BuildRequires: golang(github.com/coreos/pkg/capnslog) BuildRequires: golang(github.com/dgrijalva/jwt-go) BuildRequires: golang(github.com/dustin/go-humanize) BuildRequires: golang(github.com/ghodss/yaml) +BuildRequires: golang(github.com/gogo/protobuf/gogoproto) BuildRequires: golang(github.com/gogo/protobuf/proto) BuildRequires: golang(github.com/golang/groupcache/lru) BuildRequires: golang(github.com/golang/protobuf/proto) BuildRequires: golang(github.com/google/btree) +BuildRequires: golang(github.com/google/uuid) +BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-middleware) BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-prometheus) BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/runtime) BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/utilities) @@ -41,99 +47,89 @@ BuildRequires: golang(github.com/jonboulle/clockwork) BuildRequires: golang(github.com/kr/pty) BuildRequires: golang(github.com/olekukonko/tablewriter) BuildRequires: golang(github.com/prometheus/client_golang/prometheus) +BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promhttp) +BuildRequires: golang(github.com/prometheus/client_model/go) +BuildRequires: golang(github.com/soheilhy/cmux) BuildRequires: golang(github.com/spf13/cobra) BuildRequires: golang(github.com/spf13/pflag) +BuildRequires: golang(github.com/tmc/grpc-websocket-proxy/wsproxy) BuildRequires: golang(github.com/ugorji/go/codec) BuildRequires: golang(github.com/urfave/cli) BuildRequires: golang(github.com/xiang90/probing) +BuildRequires: golang(go.uber.org/zap) +BuildRequires: golang(go.uber.org/zap/zapcore) BuildRequires: golang(golang.org/x/crypto/bcrypt) BuildRequires: golang(golang.org/x/net/context) BuildRequires: golang(golang.org/x/net/http2) BuildRequires: golang(golang.org/x/net/trace) BuildRequires: golang(golang.org/x/time/rate) BuildRequires: golang(google.golang.org/grpc) +BuildRequires: golang(google.golang.org/grpc/balancer) BuildRequires: golang(google.golang.org/grpc/codes) +BuildRequires: golang(google.golang.org/grpc/connectivity) BuildRequires: golang(google.golang.org/grpc/credentials) BuildRequires: golang(google.golang.org/grpc/grpclog) -BuildRequires: golang(google.golang.org/grpc/metadata) -BuildRequires: golang(google.golang.org/grpc/naming) -BuildRequires: golang(google.golang.org/grpc/peer) -BuildRequires: golang(google.golang.org/grpc/transport) - -BuildRequires: systemd - -%description -A highly-available key value store for shared configuration. - -%package devel -Summary: etcd golang devel libraries -BuildArch: noarch - -BuildRequires: golang(github.com/bgentry/speakeasy) -BuildRequires: golang(github.com/cheggaaa/pb) -BuildRequires: golang(github.com/cockroachdb/cmux) -BuildRequires: golang(github.com/coreos/bbolt) -BuildRequires: golang(github.com/coreos/go-semver/semver) -BuildRequires: golang(github.com/coreos/go-systemd/daemon) -BuildRequires: golang(github.com/coreos/go-systemd/util) -BuildRequires: golang(github.com/coreos/pkg/capnslog) -BuildRequires: golang(github.com/dgrijalva/jwt-go) -BuildRequires: golang(github.com/dustin/go-humanize) -BuildRequires: golang(github.com/ghodss/yaml) -BuildRequires: golang(github.com/gogo/protobuf/proto) -BuildRequires: golang(github.com/golang/groupcache/lru) -BuildRequires: golang(github.com/golang/protobuf/proto) -BuildRequires: golang(github.com/google/btree) -BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-prometheus) -BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/runtime) -BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/utilities) -BuildRequires: golang(github.com/jonboulle/clockwork) -BuildRequires: golang(github.com/kr/pty) -BuildRequires: golang(github.com/olekukonko/tablewriter) -BuildRequires: golang(github.com/prometheus/client_golang/prometheus) -BuildRequires: golang(github.com/spf13/cobra) -BuildRequires: golang(github.com/spf13/pflag) -BuildRequires: golang(github.com/ugorji/go/codec) -BuildRequires: golang(github.com/urfave/cli) -BuildRequires: golang(github.com/xiang90/probing) -BuildRequires: golang(golang.org/x/crypto/bcrypt) -BuildRequires: golang(golang.org/x/net/context) -BuildRequires: golang(golang.org/x/net/http2) -BuildRequires: golang(golang.org/x/net/trace) -BuildRequires: golang(golang.org/x/time/rate) -BuildRequires: golang(google.golang.org/genproto/googleapis/api/annotations) -BuildRequires: golang(google.golang.org/grpc) -BuildRequires: golang(google.golang.org/grpc/codes) -BuildRequires: golang(google.golang.org/grpc/credentials) -BuildRequires: golang(google.golang.org/grpc/grpclog) +BuildRequires: golang(google.golang.org/grpc/health) BuildRequires: golang(google.golang.org/grpc/health/grpc_health_v1) BuildRequires: golang(google.golang.org/grpc/keepalive) BuildRequires: golang(google.golang.org/grpc/metadata) BuildRequires: golang(google.golang.org/grpc/naming) BuildRequires: golang(google.golang.org/grpc/peer) +BuildRequires: golang(google.golang.org/grpc/resolver) +BuildRequires: golang(google.golang.org/grpc/resolver/dns) +BuildRequires: golang(google.golang.org/grpc/resolver/passthrough) BuildRequires: golang(google.golang.org/grpc/status) +BuildRequires: golang(gopkg.in/cheggaaa/pb.v1) +BuildRequires: golang(gopkg.in/yaml.v2) +BuildRequires: golang(go.etcd.io/bbolt) +%{?systemd_requires} +BuildRequires: systemd +Requires(pre): shadow-utils + +%description +A highly-available key value store for shared configuration. + + +%package devel +Summary: etcd golang devel libraries +BuildArch: noarch %description devel -golang development libraries for etcd, a highly-available key value store for +Golang development libraries for etcd, a highly-available key value store for shared configuration. +This package contains compatibility glue for code that still imports the +%{goipath} Go namespace. + + +%package -n compat-%{oldgoname}-devel +Summary: etcd golang devel libraries +BuildArch: noarch + +%description -n compat-%{oldgoname}-devel +Golang development libraries for etcd, a highly-available key value store for +shared configuration. + +This package contains compatibility glue for code that still imports the +%{oldgoipath} Go namespace. + + %prep %setup -q -n man-%{man_version} -T -b 3 %forgesetup -%patch0 -p1 -%patch1 -p1 + +rm -rf vendor mkdir -p man/man1 cp ../man-%{man_version}/*.1 man/man1/. -sed -i 's/"gopkg\.in\/cheggaaa\/pb\.v1/"github\.com\/cheggaaa\/pb/g' $(find . -name '*.go') -#" %build %gobuildroot -%gobuild -o _bin/etcd %{goipath}/cmd/etcd -%gobuild -o _bin/etcdctl %{goipath}/cmd/etcdctl +%gobuild -o _bin/etcd %{goipath}/etcdmain +%gobuild -o _bin/etcdctl %{goipath}/etcdctl + %install install -D -p -m 0755 _bin/%{name} %{buildroot}%{_bindir}/%{name} @@ -152,26 +148,32 @@ install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name} # source codes for building projects %goinstall integration/fixtures etcdserver/api/v2http/testdata +install -m 0755 -vd %{buildroot}%{gopath}/src/%(dirname %{oldgoipath}) +ln -s %{gopath}/src/%{goipath} %{buildroot}%{gopath}/src/%{oldgoipath} + + %check # tools/functional-tester/etcd-agent expects etcd binary at GOPATH/bin/etcd %gochecks -d clientv3 -d e2e -d tools/functional-tester/etcd-agent -d integration -d clientv3/integration + %pre getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/%{name} \ - -s /sbin/nologin -c "etcd user" %{name} + -s /sbin/nologin -c "etcd user" %{name} + %post %systemd_post %{name}.service + %preun %systemd_preun %{name}.service + %postun %systemd_postun %{name}.service -#define license tag if not already defined -%{!?_licensedir:%global license %doc} %files %license LICENSE @@ -183,12 +185,24 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %{_unitdir}/%{name}.service %{_mandir}/man1/*.1* + %files devel -f devel.file-list %license LICENSE %doc *.md -%doc glide.lock + + +%files -n compat-%{oldgoname}-devel +%dir %{gopath}/src/%(dirname %{oldgoipath}) +%{gopath}/src/%{oldgoipath} + %changelog +* Thu Mar 14 2019 Robert-André Mauchin - 3.3.12-1.20190314gite1ca3b4 +- Bump to commit e1ca3b4434945e57e8e3a451cdbde74a903cc8e1 +- Add new goipath +- Updated patches +- Updated man pages + * Sun Feb 17 2019 Elliott Sales de Andrade - 3.2.16-6 - Fix broken version specification - Backport variadic parameter fix @@ -196,8 +210,7 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ * Thu Jan 31 2019 Fedora Release Engineering - 3.2.16-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild -* Tue Oct 23 2018 Nicolas Mailhot -- 3.2.16-4 +* Tue Oct 23 2018 Nicolas Mailhot - 3.2.16-4 - redhat-rpm-config-123 triggers bugs in gosetup, remove it from Go spec files as it’s just an alias - https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/RWD5YATAYAFWKIDZBB7EB6N5DAO4ZKFM/ diff --git a/etcdctl.1 b/etcdctl.1 deleted file mode 100644 index bec2361..0000000 --- a/etcdctl.1 +++ /dev/null @@ -1,25 +0,0 @@ -.TH "ETCD" "1" " etcd User Manuals" "Jan Chaloupka" "Oct 2017" "" - - -.SH NAME -.PP -etcdctl \- A simple command line client for etcd - - -.SH SYNOPSIS -.PP -\fB[ETCDCTL_API=3] etctctl\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Command line client for etcd. -Queries to v2 data model are available through \fBetcdtl\fP command (see \fBetcdctl2(1)\fP). -Queries to v3 data model are available through \fBETCDCTL=3 etcdtl\fP command (see \fBetcdctl3(1)\fP). - -.PP -Find more information at -\[la]https://github.com/coreos/etcd\[ra]. - -.SH SEE ALSO -\fBetcd(1)\fP, \fBetcdctl2(1)\fP, \fBetcdctl3(1)\fP diff --git a/etcdmain-Add-max-snapshots-and-max-wals-to-help.patch b/etcdmain-Add-max-snapshots-and-max-wals-to-help.patch deleted file mode 100644 index d607f64..0000000 --- a/etcdmain-Add-max-snapshots-and-max-wals-to-help.patch +++ /dev/null @@ -1,41 +0,0 @@ -From ddc4f8bd4501826e4c551952a96fcca6dd25bf64 Mon Sep 17 00:00:00 2001 -From: Yiqiao Pu -Date: Wed, 18 Nov 2015 17:54:46 +0800 -Subject: [PATCH] etcdmain: Add max-snapshots and max-wals to help - -Based on the configuration doc, seems these two flags are missing -in the help. So add them and the descriptions are from config.go in -the same directory. - -Signed-off-by: Yiqiao Pu ---- - etcdmain/help.go | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/etcdmain/help.go b/etcdmain/help.go -index e233320..fd23d59 100644 ---- a/etcdmain/help.go -+++ b/etcdmain/help.go -@@ -14,6 +14,8 @@ - - package etcdmain - -+import "strconv" -+ - var ( - usageline = `usage: etcd [flags] - start an etcd server -@@ -43,6 +45,10 @@ member flags: - list of URLs to listen on for peer traffic. - --listen-client-urls 'http://localhost:2379,http://localhost:4001' - list of URLs to listen on for client traffic. -+ --max-snapshots '` + strconv.Itoa(defaultMaxSnapshots) + `' -+ maximum number of snapshot files to retain (0 is unlimited). -+ --max-wals '` + strconv.Itoa(defaultMaxWALs) + `' -+ maximum number of wal files to retain (0 is unlimited). - -cors '' - comma-separated whitelist of origins for CORS (cross-origin resource sharing). - --- -1.9.3 - diff --git a/genmanpages.sh b/genmanpages.sh index fedb2a4..821818f 100755 --- a/genmanpages.sh +++ b/genmanpages.sh @@ -17,7 +17,7 @@ sed -i s"/^\\\fBetcdctl /\\\fBETCDCTL=3 etcdctl /" etcdctl3*.1 cd ../etcdctl2 ../../$1/bin/etcdctl --help > etcdctl.1 -for cmd in $(cat etcdctl.1 | grep "\fBetcdctl" | cut -d'-' -f2-3 | cut -d'(' -f1); do ../../$1/bin/etcdctl $cmd --help > etcdctl-$cmd.1; done +for cmd in $(cat etcdctl.1 | grep "\fBetcdctl\\\-" | cut -d'-' -f2-3 | cut -d'(' -f1); do ../../$1/bin/etcdctl $cmd --help > etcdctl-$cmd.1; done # rename to etcdctl2 for line in $(ls *.1); do mv $line $(echo $line | sed "s/etcdctl/etcdctl2/"); done diff --git a/hack-test.patch b/hack-test.patch deleted file mode 100644 index a6402b3..0000000 --- a/hack-test.patch +++ /dev/null @@ -1,73 +0,0 @@ -From a144093e502d4529d598ecf997fea9e261ac595d Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Mon, 15 Aug 2016 16:09:52 +0200 -Subject: [PATCH] hack test - ---- - test | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -diff --git a/test b/test -index 4f24606..deaa527 100755 ---- a/test -+++ b/test -@@ -53,7 +53,7 @@ fi - function unit_tests { - echo "Running tests..." - # only -run=Test so examples can run in integration tests -- go test -timeout 3m ${COVER} ${RACE} -cpu 1,2,4 -run=Test $@ ${TEST} -+ ${GOTEST:-go test} -timeout 3m ${COVER} ${RACE} -cpu 1,2,4 -run=Test $@ ${TEST} - } - - function integration_tests { -@@ -69,16 +69,16 @@ function integration_tests { - mv /tmp/etcd ./bin/etcd-last-release - fi; - -- go test -timeout 10m -v -cpu 1,2,4 $@ ${REPO_PATH}/e2e & -+ ${GOTEST:-go test} -timeout 10m -v -cpu 1,2,4 $@ ${REPO_PATH}/e2e & - e2epid="$!" -- go test -timeout 15m -v -cpu 1,2,4 $@ ${REPO_PATH}/integration & -+ ${GOTEST:-go test} -timeout 15m -v -cpu 1,2,4 $@ ${REPO_PATH}/integration & - intpid="$!" - wait $e2epid - wait $intpid -- go test -timeout 1m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/client/integration -- go test -timeout 10m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/clientv3/integration -- go test -timeout 1m -v -cpu 1,2,4 $@ ${REPO_PATH}/contrib/raftexample -- go test -timeout 1m -v ${RACE} -cpu 1,2,4 -run=Example $@ ${TEST} -+ ${GOTEST:-go test} -timeout 1m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/client/integration -+ ${GOTEST:-go test} -timeout 10m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/clientv3/integration -+ ${GOTEST:-go test} -timeout 1m -v -cpu 1,2,4 $@ ${REPO_PATH}/contrib/raftexample -+ ${GOTEST:-go test} -timeout 1m -v ${RACE} -cpu 1,2,4 -run=Example $@ ${TEST} - } - - function fmt_tests { -@@ -197,18 +197,18 @@ function dep_tests { - } - - # Set up gopath so tests use vendored dependencies --export GOPATH=${PWD}/gopath --rm -rf $GOPATH/src --mkdir -p $GOPATH --ln -s ${PWD}/cmd/vendor $GOPATH/src -+#export GOPATH=${PWD}/Godeps/_workspace -+#rm -rf $GOPATH/src -+#mkdir -p $GOPATH -+#ln -s ${PWD}/cmd/vendor $GOPATH/src - - # fail fast on static tests - toggle_failpoints disable --fmt_tests -+#fmt_tests - dep_tests - - # fail fast on static tests --GO_BUILD_FLAGS="-a -v" etcd_build -+#GO_BUILD_FLAGS="-a -v" etcd_build - - unit_tests - if [ -n "$INTEGRATION" ]; then --- -1.9.3 - diff --git a/run-etcd-on-ppc64le-by-default.patch b/run-etcd-on-ppc64le-by-default.patch deleted file mode 100644 index e053777..0000000 --- a/run-etcd-on-ppc64le-by-default.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 5f8e74959f19f19018ab0e6400e0f5daba3567e5 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Sat, 26 Nov 2016 13:46:29 +0100 -Subject: [PATCH] run etcd on ppc64le by default - ---- - etcdmain/etcd.go | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/etcdmain/etcd.go b/etcdmain/etcd.go -index 950513e..7225303 100644 ---- a/etcdmain/etcd.go -+++ b/etcdmain/etcd.go -@@ -636,6 +636,14 @@ func checkSupportArch() { - if runtime.GOARCH == "amd64" { - return - } -+ -+ if runtime.GOARCH == "ppc64le" { -+ plog.Warningf("Running etcd on ppc64le architecture is not supported.") -+ plog.Warningf("Be aware you are running the etcd at your own risk.") -+ plog.Warningf("For more information visit https://bugzilla.redhat.com/show_bug.cgi?id=1396463") -+ return -+ } -+ - if env, ok := os.LookupEnv("ETCD_UNSUPPORTED_ARCH"); ok && env == runtime.GOARCH { - plog.Warningf("running etcd on unsupported architecture %q since ETCD_UNSUPPORTED_ARCH is set", env) - return --- -1.9.3 - diff --git a/sources b/sources index 0bd1a5b..4c8c67e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (etcd-3.2.16.tar.gz) = 5f3322b30266b0486310243d8f0c549d718687413e82fff27b26f195619a8e70ab5018921e02495f088ebe285559da76dcbfb9da0ef1f1d3c046ff90b8e4904c -SHA512 (man-3.2.16.tar.gz) = 3bb97ea010fed98ea9297b2c4e9222559bff380e77df928c4a145757c9ce09c02ad06403d8e4a68e9f9a391ff3eb81deb77302668a8fb809b8f62ecf0c7bc283 +SHA512 (etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1.tar.gz) = ab32ee9f80f273de2ea38d1e770ef61909b9107427a7b267b338422bc61a224ad20ab66ec3731dd0d439cd7e663b0d19175db03f74a709c380270f081eb34792 +SHA512 (man-3.3.12.tar.gz) = 981374ac7c071b9541994c4ee921b90281f2f09a1c51fe03fe4d319fc1c3647419cdf688e2ac161098d772cb0264e712dad1ed9a3c12b2454dc21f79e6a5eb8c From 0b2f20d05000a0fd606f18d12aa901aa5fbb6c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sat, 13 Apr 2019 22:54:42 +0200 Subject: [PATCH 02/52] Bump to commit f29b1ada19713544b698dab8c94c97cfa1e83dac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- .gitignore | 1 + etcd.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e20e7e3..3054b05 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /man-3.2.16.tar.gz /etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1.tar.gz /man-3.3.12.tar.gz +/etcd-f29b1ada19713544b698dab8c94c97cfa1e83dac.tar.gz diff --git a/etcd.spec b/etcd.spec index f1d248e..ef49d66 100644 --- a/etcd.spec +++ b/etcd.spec @@ -3,7 +3,7 @@ %global forgeurl https://github.com/coreos/etcd %global oldgoipath github.com/coreos/etcd %global oldgoname %gorpmname %{oldgoipath} -%global commit e1ca3b4434945e57e8e3a451cdbde74a903cc8e1 +%global commit f29b1ada19713544b698dab8c94c97cfa1e83dac %gometa @@ -11,7 +11,7 @@ Name: etcd Version: 3.3.12 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A highly-available key value store for shared configuration License: ASL 2.0 URL: %{gourl} @@ -197,6 +197,9 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %changelog +* Sat Apr 13 22:31:30 CET 2019 Robert-André Mauchin - 3.3.12-2.20190413gitf29b1ad +- Bump to commit f29b1ada19713544b698dab8c94c97cfa1e83dac + * Thu Mar 14 2019 Robert-André Mauchin - 3.3.12-1.20190314gite1ca3b4 - Bump to commit e1ca3b4434945e57e8e3a451cdbde74a903cc8e1 - Add new goipath diff --git a/sources b/sources index 4c8c67e..73b680e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1.tar.gz) = ab32ee9f80f273de2ea38d1e770ef61909b9107427a7b267b338422bc61a224ad20ab66ec3731dd0d439cd7e663b0d19175db03f74a709c380270f081eb34792 +SHA512 (etcd-f29b1ada19713544b698dab8c94c97cfa1e83dac.tar.gz) = a01b197be1022472916945d7b5e99afa86a4f03f9711ce44bc286e31bbc24d7cf326113cd62f0352806bd8fe862ee76d69833d054f0768f03513d51c21e0ce6c SHA512 (man-3.3.12.tar.gz) = 981374ac7c071b9541994c4ee921b90281f2f09a1c51fe03fe4d319fc1c3647419cdf688e2ac161098d772cb0264e712dad1ed9a3c12b2454dc21f79e6a5eb8c From 2bbe85f55771aec669ec04f9e9a4bbf1325c639d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Mon, 15 Apr 2019 16:04:57 +0200 Subject: [PATCH 03/52] Fix building of etcd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- etcd.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etcd.spec b/etcd.spec index ef49d66..b86e90b 100644 --- a/etcd.spec +++ b/etcd.spec @@ -11,7 +11,7 @@ Name: etcd Version: 3.3.12 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A highly-available key value store for shared configuration License: ASL 2.0 URL: %{gourl} @@ -127,7 +127,7 @@ cp ../man-%{man_version}/*.1 man/man1/. %build %gobuildroot -%gobuild -o _bin/etcd %{goipath}/etcdmain +%gobuild -o _bin/etcd %{goipath} %gobuild -o _bin/etcdctl %{goipath}/etcdctl @@ -197,6 +197,9 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %changelog +* Mon Apr 15 15:11:24 CET 2019 Robert-André Mauchin - 3.3.12-3.20190413gitf29b1ad +- Fix building of etcd + * Sat Apr 13 22:31:30 CET 2019 Robert-André Mauchin - 3.3.12-2.20190413gitf29b1ad - Bump to commit f29b1ada19713544b698dab8c94c97cfa1e83dac From 766f1f04b85a754268cc675d516e3fbaac56eaff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Tue, 16 Apr 2019 15:50:49 +0200 Subject: [PATCH 04/52] etcd.service: do not pass command line flags already defined in environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- etcd.service | 2 +- etcd.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/etcd.service b/etcd.service index afe51ea..c9c3afe 100644 --- a/etcd.service +++ b/etcd.service @@ -10,7 +10,7 @@ WorkingDirectory=/var/lib/etcd/ EnvironmentFile=-/etc/etcd/etcd.conf User=etcd # set GOMAXPROCS to number of processors -ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd --name=\"${ETCD_NAME}\" --data-dir=\"${ETCD_DATA_DIR}\" --listen-client-urls=\"${ETCD_LISTEN_CLIENT_URLS}\"" +ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd" Restart=on-failure LimitNOFILE=65536 diff --git a/etcd.spec b/etcd.spec index b86e90b..119b255 100644 --- a/etcd.spec +++ b/etcd.spec @@ -11,7 +11,7 @@ Name: etcd Version: 3.3.12 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A highly-available key value store for shared configuration License: ASL 2.0 URL: %{gourl} @@ -197,6 +197,9 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %changelog +* Tue Apr 16 15:51:11 CET 2019 Robert-André Mauchin - 3.3.12-4.20190413gitf29b1ad +- etcd.service: do not pass command line flags already defined in environment + * Mon Apr 15 15:11:24 CET 2019 Robert-André Mauchin - 3.3.12-3.20190413gitf29b1ad - Fix building of etcd From 0028d72444152eb3a902a973f367fa26b64f3362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sat, 27 Apr 2019 21:20:22 +0200 Subject: [PATCH 05/52] Release 3.3.13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- .gitignore | 3 + ...ate-direct-use-of-gRPC-transport-pkg.patch | 139 +++++++++ etcd.spec | 266 +++++++++--------- sources | 4 +- 4 files changed, 275 insertions(+), 137 deletions(-) create mode 100644 0001-Eliminate-direct-use-of-gRPC-transport-pkg.patch diff --git a/.gitignore b/.gitignore index 3054b05..40facd9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ /etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1.tar.gz /man-3.3.12.tar.gz /etcd-f29b1ada19713544b698dab8c94c97cfa1e83dac.tar.gz +/etcd-cca0d5c1bed134ac30e1354241f7655d2a118db4.tar.gz +/etcd-3.3.13.tar.gz +/man-3.3.13.tar.gz diff --git a/0001-Eliminate-direct-use-of-gRPC-transport-pkg.patch b/0001-Eliminate-direct-use-of-gRPC-transport-pkg.patch new file mode 100644 index 0000000..f54af4b --- /dev/null +++ b/0001-Eliminate-direct-use-of-gRPC-transport-pkg.patch @@ -0,0 +1,139 @@ +From 520bd5084e3120e0eb45963446e798b1f3211d2f Mon Sep 17 00:00:00 2001 +From: Matt Brannock +Date: Wed, 18 Jul 2018 13:09:27 -0700 +Subject: [PATCH] integration, functional: Eliminate direct use of gRPC + transport pkg + +gRPC has moved the transport package to an internal-only directory. This +eliminates direct use of the transport package in the stress test in +favor of the error code from gRPC that represents a connection problem. + +https://godoc.org/google.golang.org/grpc/internal/transport is the new +location for the package, which says it's not intended to be imported +directly. Instead, the maintainers suggested to use the code Unavailable +to detect a connection problem. + +This change slightly reorganizes the stresser test error handling. +--- + functional/tester/stresser_key.go | 97 +++++++++++++++++----------- + 2 files changed, 63 insertions(+), 42 deletions(-) + +diff --git a/functional/tester/stresser_key.go b/functional/tester/stresser_key.go +index 54efddb28a..b3e46cc0e7 100644 +--- a/functional/tester/stresser_key.go ++++ b/functional/tester/stresser_key.go +@@ -31,7 +31,8 @@ import ( + "go.uber.org/zap" + "golang.org/x/time/rate" + "google.golang.org/grpc" +- "google.golang.org/grpc/transport" ++ "google.golang.org/grpc/codes" ++ "google.golang.org/grpc/status" + ) + + type keyStresser struct { +@@ -130,41 +131,7 @@ func (s *keyStresser) run() { + continue + } + +- switch rpctypes.ErrorDesc(err) { +- case context.DeadlineExceeded.Error(): +- // This retries when request is triggered at the same time as +- // leader failure. When we terminate the leader, the request to +- // that leader cannot be processed, and times out. Also requests +- // to followers cannot be forwarded to the old leader, so timing out +- // as well. We want to keep stressing until the cluster elects a +- // new leader and start processing requests again. +- case etcdserver.ErrTimeoutDueToLeaderFail.Error(), etcdserver.ErrTimeout.Error(): +- // This retries when request is triggered at the same time as +- // leader failure and follower nodes receive time out errors +- // from losing their leader. Followers should retry to connect +- // to the new leader. +- case etcdserver.ErrStopped.Error(): +- // one of the etcd nodes stopped from failure injection +- case transport.ErrConnClosing.Desc: +- // server closed the transport (failure injected node) +- case rpctypes.ErrNotCapable.Error(): +- // capability check has not been done (in the beginning) +- case rpctypes.ErrTooManyRequests.Error(): +- // hitting the recovering member. +- case context.Canceled.Error(): +- // from stresser.Cancel method: +- return +- case grpc.ErrClientConnClosing.Error(): +- // from stresser.Cancel method: +- return +- default: +- s.lg.Warn( +- "stress run exiting", +- zap.String("stress-type", s.stype.String()), +- zap.String("endpoint", s.m.EtcdClientEndpoint), +- zap.String("error-type", reflect.TypeOf(err).String()), +- zap.Error(err), +- ) ++ if !s.isRetryableError(err) { + return + } + +@@ -177,6 +144,61 @@ func (s *keyStresser) run() { + } + } + ++func (s *keyStresser) isRetryableError(err error) bool { ++ switch rpctypes.ErrorDesc(err) { ++ // retryable ++ case context.DeadlineExceeded.Error(): ++ // This retries when request is triggered at the same time as ++ // leader failure. When we terminate the leader, the request to ++ // that leader cannot be processed, and times out. Also requests ++ // to followers cannot be forwarded to the old leader, so timing out ++ // as well. We want to keep stressing until the cluster elects a ++ // new leader and start processing requests again. ++ return true ++ case etcdserver.ErrTimeoutDueToLeaderFail.Error(), etcdserver.ErrTimeout.Error(): ++ // This retries when request is triggered at the same time as ++ // leader failure and follower nodes receive time out errors ++ // from losing their leader. Followers should retry to connect ++ // to the new leader. ++ return true ++ case etcdserver.ErrStopped.Error(): ++ // one of the etcd nodes stopped from failure injection ++ return true ++ case rpctypes.ErrNotCapable.Error(): ++ // capability check has not been done (in the beginning) ++ return true ++ case rpctypes.ErrTooManyRequests.Error(): ++ // hitting the recovering member. ++ return true ++ case raft.ErrProposalDropped.Error(): ++ // removed member, or leadership has changed (old leader got raftpb.MsgProp) ++ return true ++ ++ // not retryable. ++ case context.Canceled.Error(): ++ // from stresser.Cancel method: ++ return false ++ case grpc.ErrClientConnClosing.Error(): ++ // from stresser.Cancel method: ++ return false ++ } ++ ++ if status.Convert(err).Code() == codes.Unavailable { ++ // gRPC connection errors are translated to status.Unavailable ++ return true ++ } ++ ++ s.lg.Warn( ++ "stress run exiting", ++ zap.String("stress-type", "KV"), ++ zap.String("endpoint", s.m.EtcdClientEndpoint), ++ zap.String("error-type", reflect.TypeOf(err).String()), ++ zap.String("error-desc", rpctypes.ErrorDesc(err)), ++ zap.Error(err), ++ ) ++ return false ++} ++ + func (s *keyStresser) Pause() map[string]int { + return s.Close() + } diff --git a/etcd.spec b/etcd.spec index 119b255..03afbfd 100644 --- a/etcd.spec +++ b/etcd.spec @@ -1,18 +1,32 @@ -# https://github.com/coreos/etcd +# Generated by go2rpm +%bcond_without check + +# https://github.com/etcd-io/etcd %global goipath go.etcd.io/etcd -%global forgeurl https://github.com/coreos/etcd -%global oldgoipath github.com/coreos/etcd -%global oldgoname %gorpmname %{oldgoipath} -%global commit f29b1ada19713544b698dab8c94c97cfa1e83dac +%global forgeurl https://github.com/etcd-io/etcd +Version: 3.3.13 %gometa -%global man_version 3.3.12 +%global goaltipaths github.com/coreos/etcd +%global man_version 3.3.13 + +%global common_description %{expand: +Distributed reliable key-value store for the most critical data of a distributed +system.} + +%global golicenses LICENSE NOTICE +%global godocs CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md\\\ + README.md ROADMAP.md Documentation\\\ + README-*.md READMEv2-etcdctl.md + +%global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Version: 3.3.12 -Release: 4%{?dist} -Summary: A highly-available key value store for shared configuration +Release: 1%{?dist} +Summary: Distributed reliable key-value store for the most critical data of a distributed system + +# Upstream license specification: Apache-2.0 License: ASL 2.0 URL: %{gourl} Source0: %{gosource} @@ -24,179 +38,161 @@ Source10: genmanpages.sh # Not patches to apply here, but used on the source to generate man pages Source11: 0001-hack-etcdmain-to-generate-etcd.1.patch Source12: 0001-hack-to-generate-man-pages.patch +# Needed to use newer gRPC +# https://github.com/etcd-io/etcd/commit/520bd5084e3120e0eb45963446e798b1f3211d2f +Patch0: https://github.com/etcd-io/etcd/commit/520bd5084e3120e0eb45963446e798b1f3211d2f.patch#/0001-Eliminate-direct-use-of-gRPC-transport-pkg.patch -BuildRequires: golang(github.com/bgentry/speakeasy) -BuildRequires: golang(github.com/coreos/go-semver/semver) -BuildRequires: golang(github.com/coreos/go-systemd/daemon) -BuildRequires: golang(github.com/coreos/go-systemd/journal) -BuildRequires: golang(github.com/coreos/pkg/capnslog) -BuildRequires: golang(github.com/dgrijalva/jwt-go) -BuildRequires: golang(github.com/dustin/go-humanize) -BuildRequires: golang(github.com/ghodss/yaml) -BuildRequires: golang(github.com/gogo/protobuf/gogoproto) -BuildRequires: golang(github.com/gogo/protobuf/proto) -BuildRequires: golang(github.com/golang/groupcache/lru) -BuildRequires: golang(github.com/golang/protobuf/proto) -BuildRequires: golang(github.com/google/btree) -BuildRequires: golang(github.com/google/uuid) -BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-middleware) -BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-prometheus) -BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/runtime) -BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/utilities) -BuildRequires: golang(github.com/jonboulle/clockwork) -BuildRequires: golang(github.com/kr/pty) -BuildRequires: golang(github.com/olekukonko/tablewriter) -BuildRequires: golang(github.com/prometheus/client_golang/prometheus) -BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promhttp) -BuildRequires: golang(github.com/prometheus/client_model/go) -BuildRequires: golang(github.com/soheilhy/cmux) -BuildRequires: golang(github.com/spf13/cobra) -BuildRequires: golang(github.com/spf13/pflag) -BuildRequires: golang(github.com/tmc/grpc-websocket-proxy/wsproxy) -BuildRequires: golang(github.com/ugorji/go/codec) -BuildRequires: golang(github.com/urfave/cli) -BuildRequires: golang(github.com/xiang90/probing) -BuildRequires: golang(go.uber.org/zap) -BuildRequires: golang(go.uber.org/zap/zapcore) -BuildRequires: golang(golang.org/x/crypto/bcrypt) -BuildRequires: golang(golang.org/x/net/context) -BuildRequires: golang(golang.org/x/net/http2) -BuildRequires: golang(golang.org/x/net/trace) -BuildRequires: golang(golang.org/x/time/rate) -BuildRequires: golang(google.golang.org/grpc) -BuildRequires: golang(google.golang.org/grpc/balancer) -BuildRequires: golang(google.golang.org/grpc/codes) -BuildRequires: golang(google.golang.org/grpc/connectivity) -BuildRequires: golang(google.golang.org/grpc/credentials) -BuildRequires: golang(google.golang.org/grpc/grpclog) -BuildRequires: golang(google.golang.org/grpc/health) -BuildRequires: golang(google.golang.org/grpc/health/grpc_health_v1) -BuildRequires: golang(google.golang.org/grpc/keepalive) -BuildRequires: golang(google.golang.org/grpc/metadata) -BuildRequires: golang(google.golang.org/grpc/naming) -BuildRequires: golang(google.golang.org/grpc/peer) -BuildRequires: golang(google.golang.org/grpc/resolver) -BuildRequires: golang(google.golang.org/grpc/resolver/dns) -BuildRequires: golang(google.golang.org/grpc/resolver/passthrough) -BuildRequires: golang(google.golang.org/grpc/status) -BuildRequires: golang(gopkg.in/cheggaaa/pb.v1) -BuildRequires: golang(gopkg.in/yaml.v2) -BuildRequires: golang(go.etcd.io/bbolt) +BuildRequires: golang(github.com/bgentry/speakeasy) +BuildRequires: golang(github.com/coreos/bbolt) +BuildRequires: golang(github.com/coreos/go-semver/semver) +BuildRequires: golang(github.com/coreos/go-systemd/daemon) +BuildRequires: golang(github.com/coreos/go-systemd/util) +BuildRequires: golang(github.com/coreos/pkg/capnslog) +BuildRequires: golang(github.com/dgrijalva/jwt-go) +BuildRequires: golang(github.com/dustin/go-humanize) +BuildRequires: golang(github.com/ghodss/yaml) +BuildRequires: golang(github.com/gogo/protobuf/gogoproto) +BuildRequires: golang(github.com/gogo/protobuf/proto) +BuildRequires: golang(github.com/golang/groupcache/lru) +BuildRequires: golang(github.com/golang/protobuf/proto) +BuildRequires: golang(github.com/google/btree) +BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-middleware) +BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-prometheus) +BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/runtime) +BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/utilities) +BuildRequires: golang(github.com/jonboulle/clockwork) +BuildRequires: golang(github.com/json-iterator/go) +BuildRequires: golang(github.com/kr/pty) +BuildRequires: golang(github.com/modern-go/reflect2) +BuildRequires: golang(github.com/olekukonko/tablewriter) +BuildRequires: golang(github.com/prometheus/client_golang/prometheus) +BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promhttp) +BuildRequires: golang(github.com/soheilhy/cmux) +BuildRequires: golang(github.com/spf13/cobra) +BuildRequires: golang(github.com/spf13/pflag) +BuildRequires: golang(github.com/tmc/grpc-websocket-proxy/wsproxy) +BuildRequires: golang(github.com/urfave/cli) +BuildRequires: golang(github.com/xiang90/probing) +BuildRequires: golang(go.uber.org/zap) +BuildRequires: golang(golang.org/x/crypto/bcrypt) +BuildRequires: golang(golang.org/x/net/context) +BuildRequires: golang(golang.org/x/net/http2) +BuildRequires: golang(golang.org/x/net/trace) +BuildRequires: golang(golang.org/x/time/rate) +BuildRequires: golang(google.golang.org/grpc) +BuildRequires: golang(google.golang.org/grpc/codes) +BuildRequires: golang(google.golang.org/grpc/credentials) +BuildRequires: golang(google.golang.org/grpc/grpclog) +BuildRequires: golang(google.golang.org/grpc/health) +BuildRequires: golang(google.golang.org/grpc/health/grpc_health_v1) +BuildRequires: golang(google.golang.org/grpc/keepalive) +BuildRequires: golang(google.golang.org/grpc/metadata) +BuildRequires: golang(google.golang.org/grpc/naming) +BuildRequires: golang(google.golang.org/grpc/peer) +BuildRequires: golang(google.golang.org/grpc/status) +BuildRequires: golang(gopkg.in/cheggaaa/pb.v1) +BuildRequires: golang(gopkg.in/yaml.v2) +# in 3.4 +# BuildRequires: python3-devel +# BuildRequires: %%{py3_dist sphinx sphinx-autobuild sphinx-rtd-theme} %{?systemd_requires} -BuildRequires: systemd -Requires(pre): shadow-utils +BuildRequires: systemd +Requires(pre): shadow-utils + +%if %{with check} +# Tests +BuildRequires: golang(github.com/prometheus/client_model/go) +%endif %description -A highly-available key value store for shared configuration. - - -%package devel -Summary: etcd golang devel libraries -BuildArch: noarch - -%description devel -Golang development libraries for etcd, a highly-available key value store for -shared configuration. - -This package contains compatibility glue for code that still imports the -%{goipath} Go namespace. - - -%package -n compat-%{oldgoname}-devel -Summary: etcd golang devel libraries -BuildArch: noarch - -%description -n compat-%{oldgoname}-devel -Golang development libraries for etcd, a highly-available key value store for -shared configuration. - -This package contains compatibility glue for code that still imports the -%{oldgoipath} Go namespace. +%{common_description} +%gopkg %prep %setup -q -n man-%{man_version} -T -b 3 -%forgesetup +%goprep +%patch0 -p1 +rm -rf cmd/vendor +find . -name "*.go" -exec sed -i "s|github.com/coreos/etcd|go.etcd.io/etcd|" "{}" +; -rm -rf vendor +for d in client clientv3 contrib etcdctl functional hack; do +mv $d/README.md README-$d.md +done +mv etcdctl/READMEv2.md READMEv2-etcdctl.md mkdir -p man/man1 cp ../man-%{man_version}/*.1 man/man1/. - %build -%gobuildroot - -%gobuild -o _bin/etcd %{goipath} -%gobuild -o _bin/etcdctl %{goipath}/etcdctl +%gobuild -o %{gobuilddir}/bin/etcd %{goipath} +for cmd in etcdctl; do + %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd +done +# in 3.4 +# make -C docs help +# make -C docs html %install -install -D -p -m 0755 _bin/%{name} %{buildroot}%{_bindir}/%{name} -install -D -p -m 0755 _bin/%{name}ctl %{buildroot}%{_bindir}/%{name}ctl -install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service -install -d -m 0755 %{buildroot}%{_sysconfdir}/%{name} -install -m 644 -t %{buildroot}%{_sysconfdir}/%{name} %{SOURCE2} +%gopkginstall +install -m 0755 -vd %{buildroot}%{_bindir} +install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ + +install -Dpm 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service +install -dm 0755 %{buildroot}%{_sysconfdir}/%{name} +install -pm 644 -t %{buildroot}%{_sysconfdir}/%{name} %{SOURCE2} # install manpages install -d %{buildroot}%{_mandir}/man1 -install -p -m 644 man/man1/* %{buildroot}%{_mandir}/man1 +install -pm 644 man/man1/* %{buildroot}%{_mandir}/man1 # And create /var/lib/etcd -install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name} - -# source codes for building projects -%goinstall integration/fixtures etcdserver/api/v2http/testdata - -install -m 0755 -vd %{buildroot}%{gopath}/src/%(dirname %{oldgoipath}) -ln -s %{gopath}/src/%{goipath} %{buildroot}%{gopath}/src/%{oldgoipath} - +install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} +%if %{with check} %check -# tools/functional-tester/etcd-agent expects etcd binary at GOPATH/bin/etcd -%gochecks -d clientv3 -d e2e -d tools/functional-tester/etcd-agent -d integration -d clientv3/integration - +%gocheck -d clientv3 \ + -d e2e \ + -d functional/rpcpb \ + -d tools/functional-tester/etcd-agent \ + -d integration \ + -d clientv3/integration \ + -d clientv3/balancer \ + -d pkg/flags \ + -d raft +%endif %pre getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/%{name} \ -s /sbin/nologin -c "etcd user" %{name} - %post %systemd_post %{name}.service - %preun %systemd_preun %{name}.service - %postun %systemd_postun %{name}.service - %files -%license LICENSE -%doc *.md +%license LICENSE NOTICE +%doc CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md README.md ROADMAP.md +%doc Documentation README-*.md READMEv2-etcdctl.md +%{_bindir}/* %config(noreplace) %{_sysconfdir}/%{name} -%{_bindir}/%{name} -%{_bindir}/%{name}ctl %dir %attr(-,%{name},%{name}) %{_sharedstatedir}/%{name} %{_unitdir}/%{name}.service %{_mandir}/man1/*.1* - -%files devel -f devel.file-list -%license LICENSE -%doc *.md - - -%files -n compat-%{oldgoname}-devel -%dir %{gopath}/src/%(dirname %{oldgoipath}) -%{gopath}/src/%{oldgoipath} - +%gopkgfiles %changelog +* Wed May 08 01:20:48 CEST 2019 Robert-André Mauchin - 3.3.13-1 +- Release 3.3.13 + * Tue Apr 16 15:51:11 CET 2019 Robert-André Mauchin - 3.3.12-4.20190413gitf29b1ad - etcd.service: do not pass command line flags already defined in environment diff --git a/sources b/sources index 73b680e..36a1566 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (etcd-f29b1ada19713544b698dab8c94c97cfa1e83dac.tar.gz) = a01b197be1022472916945d7b5e99afa86a4f03f9711ce44bc286e31bbc24d7cf326113cd62f0352806bd8fe862ee76d69833d054f0768f03513d51c21e0ce6c -SHA512 (man-3.3.12.tar.gz) = 981374ac7c071b9541994c4ee921b90281f2f09a1c51fe03fe4d319fc1c3647419cdf688e2ac161098d772cb0264e712dad1ed9a3c12b2454dc21f79e6a5eb8c +SHA512 (etcd-3.3.13.tar.gz) = 5b8cf9d8d8b0afd1551f414480f04837668729c10d5d81c5e9ffba3392bd2567f3798267c5e4dbe60f49dbdd859f668c6fe0d7924e0fd65f918ab3bd01d5751a +SHA512 (man-3.3.13.tar.gz) = 28a7ca63c2221c6867f8110668fbcb88b44d80650d0dba60668935b8d6fd097f40d2bbb9f26ac0a75514fe239b535a3d750aa03ffc0b37b0a29a28b14d2a72bd From 7843a0289a31c81c17f463651c374c268885375f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Mon, 24 Jun 2019 23:13:19 +0200 Subject: [PATCH 06/52] Fix extra files inclusion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- etcd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index 03afbfd..c2d5779 100644 --- a/etcd.spec +++ b/etcd.spec @@ -20,7 +20,7 @@ system.} README.md ROADMAP.md Documentation\\\ README-*.md READMEv2-etcdctl.md -%global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* +%global gosupfiles 'integration/fixtures/*' 'etcdserver/api/v2http/testdata/*' Name: etcd Release: 1%{?dist} From 853225606d5677b61e00ed3095917ae8cb70d157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Tue, 25 Jun 2019 15:18:29 +0200 Subject: [PATCH 07/52] Disable some failing tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- etcd.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index c2d5779..2009a39 100644 --- a/etcd.spec +++ b/etcd.spec @@ -20,7 +20,7 @@ system.} README.md ROADMAP.md Documentation\\\ README-*.md READMEv2-etcdctl.md -%global gosupfiles 'integration/fixtures/*' 'etcdserver/api/v2http/testdata/*' +%global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd Release: 1%{?dist} @@ -159,6 +159,7 @@ install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} -d integration \ -d clientv3/integration \ -d clientv3/balancer \ + -d clientv3/ordering \ -d pkg/flags \ -d raft %endif From 89c322da82d6088db233f35d4ab18cc1248cf054 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 10 Jul 2019 00:34:24 -0400 Subject: [PATCH 08/52] Add Obsoletes for old name. --- etcd.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index 2009a39..2852605 100644 --- a/etcd.spec +++ b/etcd.spec @@ -8,6 +8,11 @@ Version: 3.3.13 %gometa +# Remove in F33 +%global godevelheader %{expand: +Obsoletes: etcd-devel < 3.3.12-5 +} + %global goaltipaths github.com/coreos/etcd %global man_version 3.3.13 @@ -23,7 +28,7 @@ system.} %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -191,6 +196,9 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %gopkgfiles %changelog +* Wed Jul 10 2019 Elliott Sales de Andrade - 3.3.13-2 +- Add Obsoletes for old name + * Wed May 08 01:20:48 CEST 2019 Robert-André Mauchin - 3.3.13-1 - Release 3.3.13 From ccd233fee492d39f596f3ff831d896cb55a68d1c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 24 Jul 2019 23:58:27 +0000 Subject: [PATCH 09/52] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- etcd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index 2852605..5996189 100644 --- a/etcd.spec +++ b/etcd.spec @@ -28,7 +28,7 @@ system.} %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Release: 2%{?dist} +Release: 3%{?dist} Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -196,6 +196,9 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %gopkgfiles %changelog +* Wed Jul 24 2019 Fedora Release Engineering - 3.3.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Wed Jul 10 2019 Elliott Sales de Andrade - 3.3.13-2 - Add Obsoletes for old name From 31f444ef9ad4a65039a25e38b784197fbecdc991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Wed, 7 Aug 2019 19:54:37 +0200 Subject: [PATCH 10/52] Disable some failing tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- etcd.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etcd.spec b/etcd.spec index 5996189..03874e4 100644 --- a/etcd.spec +++ b/etcd.spec @@ -165,7 +165,9 @@ install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} -d clientv3/integration \ -d clientv3/balancer \ -d clientv3/ordering \ + -d pkg/expect \ -d pkg/flags \ + -d pkg/transport \ -d raft %endif From 911122fb493888bf834989863ff50c90d8740535 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 28 Jan 2020 17:52:36 +0000 Subject: [PATCH 11/52] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- etcd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index 03874e4..a0de686 100644 --- a/etcd.spec +++ b/etcd.spec @@ -28,7 +28,7 @@ system.} %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Release: 3%{?dist} +Release: 4%{?dist} Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -198,6 +198,9 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %gopkgfiles %changelog +* Tue Jan 28 2020 Fedora Release Engineering - 3.3.13-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Wed Jul 24 2019 Fedora Release Engineering - 3.3.13-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From b26cf08a513664edbeeca99b48a53682dd21fbf8 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 17 Feb 2020 03:19:46 -0500 Subject: [PATCH 12/52] Rebuilt for GHSA-jf24-p9p9-4rjh. --- etcd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index a0de686..ca09384 100644 --- a/etcd.spec +++ b/etcd.spec @@ -28,7 +28,7 @@ system.} %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Release: 4%{?dist} +Release: 5%{?dist} Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -198,6 +198,9 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %gopkgfiles %changelog +* Mon Feb 17 2020 Elliott Sales de Andrade - 3.3.13-5 +- Rebuilt for GHSA-jf24-p9p9-4rjh + * Tue Jan 28 2020 Fedora Release Engineering - 3.3.13-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 17ba79b85c40c3e76f0f020e12834572ee7a374c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sun, 5 Apr 2020 16:13:24 +0200 Subject: [PATCH 13/52] Update to 3.4.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- .gitignore | 4 + ...ate-direct-use-of-gRPC-transport-pkg.patch | 139 ------------------ 0001-hack-etcdmain-to-generate-etcd.1.patch | 41 +++--- 0001-remove-unknown-field-Etcd.Debug.patch | 37 +++++ etcd.spec | 54 ++++--- etcdctl.1 | 25 ++++ genmanpages.sh | 2 +- sources | 4 +- 8 files changed, 126 insertions(+), 180 deletions(-) delete mode 100644 0001-Eliminate-direct-use-of-gRPC-transport-pkg.patch create mode 100644 0001-remove-unknown-field-Etcd.Debug.patch create mode 100644 etcdctl.1 diff --git a/.gitignore b/.gitignore index 40facd9..c96a402 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ /etcd-cca0d5c1bed134ac30e1354241f7655d2a118db4.tar.gz /etcd-3.3.13.tar.gz /man-3.3.13.tar.gz +/etcd-3.4.3.tar.gz +/man-3.4.3.tar.gz +/etcd-3.4.7.tar.gz +/man-3.4.7.tar.gz diff --git a/0001-Eliminate-direct-use-of-gRPC-transport-pkg.patch b/0001-Eliminate-direct-use-of-gRPC-transport-pkg.patch deleted file mode 100644 index f54af4b..0000000 --- a/0001-Eliminate-direct-use-of-gRPC-transport-pkg.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 520bd5084e3120e0eb45963446e798b1f3211d2f Mon Sep 17 00:00:00 2001 -From: Matt Brannock -Date: Wed, 18 Jul 2018 13:09:27 -0700 -Subject: [PATCH] integration, functional: Eliminate direct use of gRPC - transport pkg - -gRPC has moved the transport package to an internal-only directory. This -eliminates direct use of the transport package in the stress test in -favor of the error code from gRPC that represents a connection problem. - -https://godoc.org/google.golang.org/grpc/internal/transport is the new -location for the package, which says it's not intended to be imported -directly. Instead, the maintainers suggested to use the code Unavailable -to detect a connection problem. - -This change slightly reorganizes the stresser test error handling. ---- - functional/tester/stresser_key.go | 97 +++++++++++++++++----------- - 2 files changed, 63 insertions(+), 42 deletions(-) - -diff --git a/functional/tester/stresser_key.go b/functional/tester/stresser_key.go -index 54efddb28a..b3e46cc0e7 100644 ---- a/functional/tester/stresser_key.go -+++ b/functional/tester/stresser_key.go -@@ -31,7 +31,8 @@ import ( - "go.uber.org/zap" - "golang.org/x/time/rate" - "google.golang.org/grpc" -- "google.golang.org/grpc/transport" -+ "google.golang.org/grpc/codes" -+ "google.golang.org/grpc/status" - ) - - type keyStresser struct { -@@ -130,41 +131,7 @@ func (s *keyStresser) run() { - continue - } - -- switch rpctypes.ErrorDesc(err) { -- case context.DeadlineExceeded.Error(): -- // This retries when request is triggered at the same time as -- // leader failure. When we terminate the leader, the request to -- // that leader cannot be processed, and times out. Also requests -- // to followers cannot be forwarded to the old leader, so timing out -- // as well. We want to keep stressing until the cluster elects a -- // new leader and start processing requests again. -- case etcdserver.ErrTimeoutDueToLeaderFail.Error(), etcdserver.ErrTimeout.Error(): -- // This retries when request is triggered at the same time as -- // leader failure and follower nodes receive time out errors -- // from losing their leader. Followers should retry to connect -- // to the new leader. -- case etcdserver.ErrStopped.Error(): -- // one of the etcd nodes stopped from failure injection -- case transport.ErrConnClosing.Desc: -- // server closed the transport (failure injected node) -- case rpctypes.ErrNotCapable.Error(): -- // capability check has not been done (in the beginning) -- case rpctypes.ErrTooManyRequests.Error(): -- // hitting the recovering member. -- case context.Canceled.Error(): -- // from stresser.Cancel method: -- return -- case grpc.ErrClientConnClosing.Error(): -- // from stresser.Cancel method: -- return -- default: -- s.lg.Warn( -- "stress run exiting", -- zap.String("stress-type", s.stype.String()), -- zap.String("endpoint", s.m.EtcdClientEndpoint), -- zap.String("error-type", reflect.TypeOf(err).String()), -- zap.Error(err), -- ) -+ if !s.isRetryableError(err) { - return - } - -@@ -177,6 +144,61 @@ func (s *keyStresser) run() { - } - } - -+func (s *keyStresser) isRetryableError(err error) bool { -+ switch rpctypes.ErrorDesc(err) { -+ // retryable -+ case context.DeadlineExceeded.Error(): -+ // This retries when request is triggered at the same time as -+ // leader failure. When we terminate the leader, the request to -+ // that leader cannot be processed, and times out. Also requests -+ // to followers cannot be forwarded to the old leader, so timing out -+ // as well. We want to keep stressing until the cluster elects a -+ // new leader and start processing requests again. -+ return true -+ case etcdserver.ErrTimeoutDueToLeaderFail.Error(), etcdserver.ErrTimeout.Error(): -+ // This retries when request is triggered at the same time as -+ // leader failure and follower nodes receive time out errors -+ // from losing their leader. Followers should retry to connect -+ // to the new leader. -+ return true -+ case etcdserver.ErrStopped.Error(): -+ // one of the etcd nodes stopped from failure injection -+ return true -+ case rpctypes.ErrNotCapable.Error(): -+ // capability check has not been done (in the beginning) -+ return true -+ case rpctypes.ErrTooManyRequests.Error(): -+ // hitting the recovering member. -+ return true -+ case raft.ErrProposalDropped.Error(): -+ // removed member, or leadership has changed (old leader got raftpb.MsgProp) -+ return true -+ -+ // not retryable. -+ case context.Canceled.Error(): -+ // from stresser.Cancel method: -+ return false -+ case grpc.ErrClientConnClosing.Error(): -+ // from stresser.Cancel method: -+ return false -+ } -+ -+ if status.Convert(err).Code() == codes.Unavailable { -+ // gRPC connection errors are translated to status.Unavailable -+ return true -+ } -+ -+ s.lg.Warn( -+ "stress run exiting", -+ zap.String("stress-type", "KV"), -+ zap.String("endpoint", s.m.EtcdClientEndpoint), -+ zap.String("error-type", reflect.TypeOf(err).String()), -+ zap.String("error-desc", rpctypes.ErrorDesc(err)), -+ zap.Error(err), -+ ) -+ return false -+} -+ - func (s *keyStresser) Pause() map[string]int { - return s.Close() - } diff --git a/0001-hack-etcdmain-to-generate-etcd.1.patch b/0001-hack-etcdmain-to-generate-etcd.1.patch index 4476430..8f55e50 100644 --- a/0001-hack-etcdmain-to-generate-etcd.1.patch +++ b/0001-hack-etcdmain-to-generate-etcd.1.patch @@ -1,7 +1,7 @@ -diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go ---- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 2019-03-14 20:11:28.569755622 +0100 -+++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go 2019-03-14 20:23:17.601851367 +0100 -@@ -122,14 +122,14 @@ func newConfig() *config { +diff -up etcd-3.4.3/etcdmain/config.go.orig etcd-3.4.3/etcdmain/config.go +--- etcd-3.4.3/etcdmain/config.go.orig 2019-10-23 19:11:46.000000000 +0200 ++++ etcd-3.4.3/etcdmain/config.go 2020-02-06 01:16:58.443641282 +0100 +@@ -123,14 +123,15 @@ func newConfig() *config { ), } @@ -12,14 +12,14 @@ diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 fmt.Fprintln(os.Stderr, usageline) } - fs.StringVar(&cfg.configFile, "config-file", "", "Path to the server configuration file") + fs.StringVar(&cfg.configFile, "config-file", "", "Path to the server configuration file. Note that if a configuration file is provided, other command line flags and environment variables will be ignored.") -- // member + // member + fs.AddGroup("member") fs.StringVar(&cfg.ec.Dir, "data-dir", cfg.ec.Dir, "Path to the data directory.") fs.StringVar(&cfg.ec.WalDir, "wal-dir", cfg.ec.WalDir, "Path to the dedicated wal directory.") fs.Var( -@@ -162,7 +162,7 @@ func newConfig() *config { +@@ -163,7 +164,7 @@ func newConfig() *config { fs.DurationVar(&cfg.ec.GRPCKeepAliveInterval, "grpc-keepalive-interval", cfg.ec.GRPCKeepAliveInterval, "Frequency duration of server-to-client ping to check if a connection is alive (0 to disable).") fs.DurationVar(&cfg.ec.GRPCKeepAliveTimeout, "grpc-keepalive-timeout", cfg.ec.GRPCKeepAliveTimeout, "Additional duration of wait before closing a non-responsive connection (0 to disable).") @@ -28,7 +28,7 @@ diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 fs.Var( flags.NewUniqueURLsWithExceptions(embed.DefaultInitialAdvertisePeerURLs, ""), "initial-advertise-peer-urls", -@@ -187,7 +187,7 @@ func newConfig() *config { +@@ -188,7 +189,7 @@ func newConfig() *config { fs.BoolVar(&cfg.ec.EnableV2, "enable-v2", cfg.ec.EnableV2, "Accept etcd V2 client requests.") fs.BoolVar(&cfg.ec.PreVote, "pre-vote", cfg.ec.PreVote, "Enable to run an additional Raft election phase.") @@ -37,7 +37,7 @@ diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 fs.Var(cfg.cf.proxy, "proxy", fmt.Sprintf("Valid values include %q", cfg.cf.proxy.Valids())) fs.UintVar(&cfg.cp.ProxyFailureWaitMs, "proxy-failure-wait", cfg.cp.ProxyFailureWaitMs, "Time (in milliseconds) an endpoint will be held in a failed state.") fs.UintVar(&cfg.cp.ProxyRefreshIntervalMs, "proxy-refresh-interval", cfg.cp.ProxyRefreshIntervalMs, "Time (in milliseconds) of the endpoints refresh interval.") -@@ -195,7 +195,7 @@ func newConfig() *config { +@@ -196,7 +197,7 @@ func newConfig() *config { fs.UintVar(&cfg.cp.ProxyWriteTimeoutMs, "proxy-write-timeout", cfg.cp.ProxyWriteTimeoutMs, "Time (in milliseconds) for a write to timeout.") fs.UintVar(&cfg.cp.ProxyReadTimeoutMs, "proxy-read-timeout", cfg.cp.ProxyReadTimeoutMs, "Time (in milliseconds) for a read to timeout.") @@ -46,17 +46,18 @@ diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 fs.StringVar(&cfg.ec.ClientTLSInfo.CertFile, "cert-file", "", "Path to the client server TLS cert file.") fs.StringVar(&cfg.ec.ClientTLSInfo.KeyFile, "key-file", "", "Path to the client server TLS key file.") fs.BoolVar(&cfg.ec.ClientTLSInfo.ClientCertAuth, "client-cert-auth", false, "Enable client cert authentication.") -@@ -218,41 +218,44 @@ func newConfig() *config { +@@ -222,7 +223,7 @@ func newConfig() *config { ) fs.Var(flags.NewUniqueStringsValue("*"), "host-whitelist", "Comma-separated acceptable hostnames from HTTP client requests, if server is not secure (empty means allow all).") - // logging + fs.AddGroup("logging") - fs.StringVar(&cfg.ec.Logger, "logger", "capnslog", "Specify 'zap' for structured logging or 'capnslog'.") - fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-output", "DEPRECATED: use '--log-outputs'.") + fs.StringVar(&cfg.ec.Logger, "logger", "capnslog", "Specify 'zap' for structured logging or 'capnslog'. WARN: 'capnslog' is being deprecated in v3.5.") + fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-output", "[TO BE DEPRECATED IN v3.5] use '--log-outputs'.") fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-outputs", "Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd, or list of comma separated output targets.") - fs.BoolVar(&cfg.ec.Debug, "debug", false, "Enable debug-level logging for etcd.") - fs.StringVar(&cfg.ec.LogPkgLevels, "log-package-levels", "", "(To be deprecated) Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG').") +@@ -230,26 +231,26 @@ func newConfig() *config { + fs.StringVar(&cfg.ec.LogLevel, "log-level", logutil.DefaultLogLevel, "Configures log level. Only supports debug, info, warn, error, panic, or fatal. Default 'info'.") + fs.StringVar(&cfg.ec.LogPkgLevels, "log-package-levels", "", "[TO BE DEPRECATED IN v3.5] Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG').") - // version + fs.AddGroup("version") @@ -86,7 +87,9 @@ diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 fs.BoolVar(&cfg.ec.ExperimentalInitialCorruptCheck, "experimental-initial-corrupt-check", cfg.ec.ExperimentalInitialCorruptCheck, "Enable to check data corruption before serving any client/peer traffic.") fs.DurationVar(&cfg.ec.ExperimentalCorruptCheckTime, "experimental-corrupt-check-time", cfg.ec.ExperimentalCorruptCheckTime, "Duration of time between cluster corruption check passes.") fs.StringVar(&cfg.ec.ExperimentalEnableV2V3, "experimental-enable-v2v3", cfg.ec.ExperimentalEnableV2V3, "v3 prefix for serving emulated v2 state.") - fs.StringVar(&cfg.ec.ExperimentalBackendFreelistType, "experimental-backend-bbolt-freelist-type", cfg.ec.ExperimentalBackendFreelistType, "ExperimentalBackendFreelistType specifies the type of freelist that boltdb backend uses(array and map are supported types)") +@@ -257,9 +258,12 @@ func newConfig() *config { + fs.BoolVar(&cfg.ec.ExperimentalEnableLeaseCheckpoint, "experimental-enable-lease-checkpoint", false, "Enable to persist lease remaining TTL to prevent indefinite auto-renewal of long lived leases.") + fs.IntVar(&cfg.ec.ExperimentalCompactionBatchLimit, "experimental-compaction-batch-limit", cfg.ec.ExperimentalCompactionBatchLimit, "Sets the maximum revisions deleted in each compaction batch.") - // unsafe + fs.AddGroup("unsafe") @@ -94,13 +97,13 @@ diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/config.go.hack1 + fs.GenMan() + os.Exit(0) -+ ++ // ignored for _, f := range cfg.ignored { fs.Var(&flags.IgnoredFlag{Name: f}, f, "") -diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go.hack1 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go ---- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go.hack1 2019-03-14 20:11:28.570755620 +0100 -+++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdmain/fake_flagset.go 2019-03-14 20:11:28.570755620 +0100 +diff -up etcd-3.4.3/etcdmain/fake_flagset.go.orig etcd-3.4.3/etcdmain/fake_flagset.go +--- etcd-3.4.3/etcdmain/fake_flagset.go.orig 2020-02-06 01:14:12.639989665 +0100 ++++ etcd-3.4.3/etcdmain/fake_flagset.go 2020-02-06 01:14:12.639989665 +0100 @@ -0,0 +1,157 @@ +package etcdmain + diff --git a/0001-remove-unknown-field-Etcd.Debug.patch b/0001-remove-unknown-field-Etcd.Debug.patch new file mode 100644 index 0000000..76ec821 --- /dev/null +++ b/0001-remove-unknown-field-Etcd.Debug.patch @@ -0,0 +1,37 @@ +From 2c95b49b63651ae3e0a3f63c45c05295d1af2c42 Mon Sep 17 00:00:00 2001 +From: lsytj0413 <511121939@qq.com> +Date: Thu, 19 Sep 2019 09:51:51 +0800 +Subject: [PATCH] test(functional): remove unknown field Etcd.Debug + +--- + functional/tester/cluster_test.go | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/functional/tester/cluster_test.go b/functional/tester/cluster_test.go +index 7c7b25f2ad..2948c00e7f 100644 +--- a/functional/tester/cluster_test.go ++++ b/functional/tester/cluster_test.go +@@ -64,7 +64,6 @@ func Test_read(t *testing.T) { + InitialCorruptCheck: true, + Logger: "zap", + LogOutputs: []string{"/tmp/etcd-functional-1/etcd.log"}, +- Debug: true, + }, + ClientCertData: "", + ClientCertPath: "", +@@ -117,7 +116,6 @@ func Test_read(t *testing.T) { + InitialCorruptCheck: true, + Logger: "zap", + LogOutputs: []string{"/tmp/etcd-functional-2/etcd.log"}, +- Debug: true, + }, + ClientCertData: "", + ClientCertPath: "", +@@ -170,7 +168,6 @@ func Test_read(t *testing.T) { + InitialCorruptCheck: true, + Logger: "zap", + LogOutputs: []string{"/tmp/etcd-functional-3/etcd.log"}, +- Debug: true, + }, + ClientCertData: "", + ClientCertPath: "", diff --git a/etcd.spec b/etcd.spec index ca09384..772dcea 100644 --- a/etcd.spec +++ b/etcd.spec @@ -4,7 +4,7 @@ # https://github.com/etcd-io/etcd %global goipath go.etcd.io/etcd %global forgeurl https://github.com/etcd-io/etcd -Version: 3.3.13 +Version: 3.4.7 %gometa @@ -14,21 +14,20 @@ Obsoletes: etcd-devel < 3.3.12-5 } %global goaltipaths github.com/coreos/etcd -%global man_version 3.3.13 +%global man_version 3.4.7 %global common_description %{expand: Distributed reliable key-value store for the most critical data of a distributed system.} %global golicenses LICENSE NOTICE -%global godocs CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md\\\ - README.md ROADMAP.md Documentation\\\ +%global godocs CONTRIBUTING.md README.md Documentation\\\ README-*.md READMEv2-etcdctl.md %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Release: 5%{?dist} +Release: 1%{?dist} Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -43,31 +42,30 @@ Source10: genmanpages.sh # Not patches to apply here, but used on the source to generate man pages Source11: 0001-hack-etcdmain-to-generate-etcd.1.patch Source12: 0001-hack-to-generate-man-pages.patch -# Needed to use newer gRPC -# https://github.com/etcd-io/etcd/commit/520bd5084e3120e0eb45963446e798b1f3211d2f -Patch0: https://github.com/etcd-io/etcd/commit/520bd5084e3120e0eb45963446e798b1f3211d2f.patch#/0001-Eliminate-direct-use-of-gRPC-transport-pkg.patch +# Fix a test +Patch0: https://github.com/etcd-io/etcd/commit/2c95b49b63651ae3e0a3f63c45c05295d1af2c42.patch#/0001-remove-unknown-field-Etcd.Debug.patch BuildRequires: golang(github.com/bgentry/speakeasy) -BuildRequires: golang(github.com/coreos/bbolt) +# BuildRequires: golang(github.com/cockroachdb/datadriven) BuildRequires: golang(github.com/coreos/go-semver/semver) BuildRequires: golang(github.com/coreos/go-systemd/daemon) -BuildRequires: golang(github.com/coreos/go-systemd/util) +BuildRequires: golang(github.com/coreos/go-systemd/journal) BuildRequires: golang(github.com/coreos/pkg/capnslog) +BuildRequires: golang(github.com/creack/pty) BuildRequires: golang(github.com/dgrijalva/jwt-go) BuildRequires: golang(github.com/dustin/go-humanize) -BuildRequires: golang(github.com/ghodss/yaml) BuildRequires: golang(github.com/gogo/protobuf/gogoproto) BuildRequires: golang(github.com/gogo/protobuf/proto) BuildRequires: golang(github.com/golang/groupcache/lru) BuildRequires: golang(github.com/golang/protobuf/proto) BuildRequires: golang(github.com/google/btree) +BuildRequires: golang(github.com/google/uuid) BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-middleware) BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-prometheus) BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/runtime) BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/utilities) BuildRequires: golang(github.com/jonboulle/clockwork) BuildRequires: golang(github.com/json-iterator/go) -BuildRequires: golang(github.com/kr/pty) BuildRequires: golang(github.com/modern-go/reflect2) BuildRequires: golang(github.com/olekukonko/tablewriter) BuildRequires: golang(github.com/prometheus/client_golang/prometheus) @@ -78,14 +76,18 @@ BuildRequires: golang(github.com/spf13/pflag) BuildRequires: golang(github.com/tmc/grpc-websocket-proxy/wsproxy) BuildRequires: golang(github.com/urfave/cli) BuildRequires: golang(github.com/xiang90/probing) +BuildRequires: golang(go.etcd.io/bbolt) BuildRequires: golang(go.uber.org/zap) +BuildRequires: golang(go.uber.org/zap/zapcore) BuildRequires: golang(golang.org/x/crypto/bcrypt) BuildRequires: golang(golang.org/x/net/context) BuildRequires: golang(golang.org/x/net/http2) BuildRequires: golang(golang.org/x/net/trace) BuildRequires: golang(golang.org/x/time/rate) BuildRequires: golang(google.golang.org/grpc) +BuildRequires: golang(google.golang.org/grpc/balancer) BuildRequires: golang(google.golang.org/grpc/codes) +BuildRequires: golang(google.golang.org/grpc/connectivity) BuildRequires: golang(google.golang.org/grpc/credentials) BuildRequires: golang(google.golang.org/grpc/grpclog) BuildRequires: golang(google.golang.org/grpc/health) @@ -94,12 +96,16 @@ BuildRequires: golang(google.golang.org/grpc/keepalive) BuildRequires: golang(google.golang.org/grpc/metadata) BuildRequires: golang(google.golang.org/grpc/naming) BuildRequires: golang(google.golang.org/grpc/peer) +BuildRequires: golang(google.golang.org/grpc/resolver) +BuildRequires: golang(google.golang.org/grpc/resolver/dns) +BuildRequires: golang(google.golang.org/grpc/resolver/passthrough) BuildRequires: golang(google.golang.org/grpc/status) BuildRequires: golang(gopkg.in/cheggaaa/pb.v1) BuildRequires: golang(gopkg.in/yaml.v2) -# in 3.4 -# BuildRequires: python3-devel -# BuildRequires: %%{py3_dist sphinx sphinx-autobuild sphinx-rtd-theme} +BuildRequires: golang(sigs.k8s.io/yaml) + +BuildRequires: python3-devel +# BuildRequires: %%{py3_dist sphinx sphinx-rtd-theme} %{?systemd_requires} BuildRequires: systemd Requires(pre): shadow-utils @@ -119,7 +125,11 @@ BuildRequires: golang(github.com/prometheus/client_model/go) %goprep %patch0 -p1 rm -rf cmd/vendor -find . -name "*.go" -exec sed -i "s|github.com/coreos/etcd|go.etcd.io/etcd|" "{}" +; +rm -rf raft/rafttest +# For compatibility +cp -aR etcdserver/api/snap snap +cp -aR etcdserver/api/membership etcdserver/membership +cp -aR etcdserver/api/v2store store for d in client clientv3 contrib etcdctl functional hack; do mv $d/README.md README-$d.md @@ -135,7 +145,6 @@ for cmd in etcdctl; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done -# in 3.4 # make -C docs help # make -C docs html @@ -160,15 +169,19 @@ install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} %gocheck -d clientv3 \ -d e2e \ -d functional/rpcpb \ + -d functional/tester \ -d tools/functional-tester/etcd-agent \ -d integration \ -d clientv3/integration \ -d clientv3/balancer \ + -d clientv3/snapshot \ -d clientv3/ordering \ -d pkg/expect \ -d pkg/flags \ + -d pkg/tlsutil \ -d pkg/transport \ - -d raft + -t raft \ + -t tests/e2e %endif %pre @@ -187,7 +200,7 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %files %license LICENSE NOTICE -%doc CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md README.md ROADMAP.md +%doc CONTRIBUTING.md README.md %doc Documentation README-*.md READMEv2-etcdctl.md %{_bindir}/* %config(noreplace) %{_sysconfdir}/%{name} @@ -198,6 +211,9 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %gopkgfiles %changelog +* Sun Apr 05 15:36:23 CEST 2020 Robert-André Mauchin - 3.4.7-1 +- Update to 3.4.7 + * Mon Feb 17 2020 Elliott Sales de Andrade - 3.3.13-5 - Rebuilt for GHSA-jf24-p9p9-4rjh diff --git a/etcdctl.1 b/etcdctl.1 new file mode 100644 index 0000000..bec2361 --- /dev/null +++ b/etcdctl.1 @@ -0,0 +1,25 @@ +.TH "ETCD" "1" " etcd User Manuals" "Jan Chaloupka" "Oct 2017" "" + + +.SH NAME +.PP +etcdctl \- A simple command line client for etcd + + +.SH SYNOPSIS +.PP +\fB[ETCDCTL_API=3] etctctl\fP [OPTIONS] + + +.SH DESCRIPTION +.PP +Command line client for etcd. +Queries to v2 data model are available through \fBetcdtl\fP command (see \fBetcdctl2(1)\fP). +Queries to v3 data model are available through \fBETCDCTL=3 etcdtl\fP command (see \fBetcdctl3(1)\fP). + +.PP +Find more information at +\[la]https://github.com/coreos/etcd\[ra]. + +.SH SEE ALSO +\fBetcd(1)\fP, \fBetcdctl2(1)\fP, \fBetcdctl3(1)\fP diff --git a/genmanpages.sh b/genmanpages.sh index 821818f..a933c40 100755 --- a/genmanpages.sh +++ b/genmanpages.sh @@ -23,7 +23,7 @@ for cmd in $(cat etcdctl.1 | grep "\fBetcdctl\\\-" | cut -d'-' -f2-3 | cut -d'(' for line in $(ls *.1); do mv $line $(echo $line | sed "s/etcdctl/etcdctl2/"); done # rename refs -sed -i "s/\\\fBetcdctl-/\\\fBetcdctl2-/g" *.1 +sed -i "s/\\\fBetcdctl\\\-/\\\fBetcdctl2\\\-/g" *.1 cd .. mv etcdctl2/* . diff --git a/sources b/sources index 36a1566..b459fad 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (etcd-3.3.13.tar.gz) = 5b8cf9d8d8b0afd1551f414480f04837668729c10d5d81c5e9ffba3392bd2567f3798267c5e4dbe60f49dbdd859f668c6fe0d7924e0fd65f918ab3bd01d5751a -SHA512 (man-3.3.13.tar.gz) = 28a7ca63c2221c6867f8110668fbcb88b44d80650d0dba60668935b8d6fd097f40d2bbb9f26ac0a75514fe239b535a3d750aa03ffc0b37b0a29a28b14d2a72bd +SHA512 (etcd-3.4.7.tar.gz) = 18851be0cbe8dabc6be8ba0c61d783f21b1fb9403256166016767926c731f1d95a1adebad9f36d43c57a424a7ac88c49b1d1ce01c2aa065e5bbbff847eb9234a +SHA512 (man-3.4.7.tar.gz) = 702297c4bffcd27e73e2c9056761b1fc06892697805a9601c35ddc2ed553ef49bb4f75e943df21ecb246467050f4f814e0f85e9b62a115a04614819fec9709df From ba0cd9fb88ba9e2b9f605b260d7224188d258999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sun, 5 Apr 2020 16:46:26 +0200 Subject: [PATCH 14/52] Disable more network tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- etcd.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/etcd.spec b/etcd.spec index 772dcea..b905a0e 100644 --- a/etcd.spec +++ b/etcd.spec @@ -178,6 +178,7 @@ install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} -d clientv3/ordering \ -d pkg/expect \ -d pkg/flags \ + -d pkg/proxy \ -d pkg/tlsutil \ -d pkg/transport \ -t raft \ From 0c4425c1a23851915b74330ffb5a8852408fe135 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Mon, 27 Jul 2020 16:58:52 +0000 Subject: [PATCH 15/52] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- etcd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index b905a0e..b425442 100644 --- a/etcd.spec +++ b/etcd.spec @@ -27,7 +27,7 @@ system.} %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -212,6 +212,9 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %gopkgfiles %changelog +* Mon Jul 27 2020 Fedora Release Engineering - 3.4.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Sun Apr 05 15:36:23 CEST 2020 Robert-André Mauchin - 3.4.7-1 - Update to 3.4.7 From 3289fe09ebf17f32e0a34030b9b2d64b3bcceccf Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 1 Aug 2020 00:52:39 +0000 Subject: [PATCH 16/52] - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- etcd.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index b425442..3442b62 100644 --- a/etcd.spec +++ b/etcd.spec @@ -27,7 +27,7 @@ system.} %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Release: 2%{?dist} +Release: 3%{?dist} Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -212,6 +212,10 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %gopkgfiles %changelog +* Sat Aug 01 2020 Fedora Release Engineering - 3.4.7-3 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Mon Jul 27 2020 Fedora Release Engineering - 3.4.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From e3ead832401d503007f832c2a7c3cc25a13b8f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Fri, 4 Sep 2020 01:32:04 +0200 Subject: [PATCH 17/52] Update to 3.4.13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- .gitignore | 2 + ...ert-int-to-string-using-strconv.Itoa.patch | 61 +++ 0001-hack-etcdmain-to-generate-etcd.1.patch | 25 +- 0001-hack-to-generate-man-pages.patch | 18 +- etcd.spec | 45 +- fix_for_latest_grpc.patch | 424 ++++++++++++++++++ sources | 4 +- 7 files changed, 545 insertions(+), 34 deletions(-) create mode 100644 0001-Convert-int-to-string-using-strconv.Itoa.patch create mode 100644 fix_for_latest_grpc.patch diff --git a/.gitignore b/.gitignore index c96a402..d3ab0d7 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ /man-3.4.3.tar.gz /etcd-3.4.7.tar.gz /man-3.4.7.tar.gz +/etcd-3.4.13.tar.gz +/man-3.4.13.tar.gz diff --git a/0001-Convert-int-to-string-using-strconv.Itoa.patch b/0001-Convert-int-to-string-using-strconv.Itoa.patch new file mode 100644 index 0000000..a2178d7 --- /dev/null +++ b/0001-Convert-int-to-string-using-strconv.Itoa.patch @@ -0,0 +1,61 @@ +From 80c8dfe084f44eb660aa1af5b5d49e27e1dfd11e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= +Date: Mon, 10 Aug 2020 15:09:08 +0200 +Subject: [PATCH] Convert int to string using strconv.Itoa +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +See https://github.com/golang/go/issues/32479 + +Signed-off-by: Robert-André Mauchin +--- + etcdserver/api/v2store/store_test.go | 3 ++- + wal/wal_test.go | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/etcdserver/api/v2store/store_test.go b/etcdserver/api/v2store/store_test.go +index 76ec02d4e..0b1e9dad1 100644 +--- a/etcdserver/api/v2store/store_test.go ++++ b/etcdserver/api/v2store/store_test.go +@@ -15,6 +15,7 @@ + package v2store_test + + import ( ++ "strconv" + "testing" + "time" + +@@ -844,7 +845,7 @@ func TestStoreWatchSlowConsumer(t *testing.T) { + s.Watch("/foo", true, true, 0) // stream must be true + // Fill watch channel with 100 events + for i := 1; i <= 100; i++ { +- s.Set("/foo", false, string(i), v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok ++ s.Set("/foo", false, strconv.Itoa(i), v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok + } + // testutil.AssertEqual(t, s.WatcherHub.count, int64(1)) + s.Set("/foo", false, "101", v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok +diff --git a/wal/wal_test.go b/wal/wal_test.go +index f457dbf3c..8e8a252a0 100644 +--- a/wal/wal_test.go ++++ b/wal/wal_test.go +@@ -25,6 +25,7 @@ import ( + "path/filepath" + "reflect" + "regexp" ++ "strconv" + "testing" + + "go.etcd.io/etcd/pkg/fileutil" +@@ -239,7 +240,7 @@ func TestVerify(t *testing.T) { + + // make 5 separate files + for i := 0; i < 5; i++ { +- es := []raftpb.Entry{{Index: uint64(i), Data: []byte("waldata" + string(i+1))}} ++ es := []raftpb.Entry{{Index: uint64(i), Data: []byte("waldata" + strconv.Itoa(i+1))}} + if err = w.Save(raftpb.HardState{}, es); err != nil { + t.Fatal(err) + } +-- +2.26.2 + diff --git a/0001-hack-etcdmain-to-generate-etcd.1.patch b/0001-hack-etcdmain-to-generate-etcd.1.patch index 8f55e50..6c715d7 100644 --- a/0001-hack-etcdmain-to-generate-etcd.1.patch +++ b/0001-hack-etcdmain-to-generate-etcd.1.patch @@ -1,6 +1,6 @@ -diff -up etcd-3.4.3/etcdmain/config.go.orig etcd-3.4.3/etcdmain/config.go ---- etcd-3.4.3/etcdmain/config.go.orig 2019-10-23 19:11:46.000000000 +0200 -+++ etcd-3.4.3/etcdmain/config.go 2020-02-06 01:16:58.443641282 +0100 +diff -up etcd-3.4.13/etcdmain/config.go.orig etcd-3.4.13/etcdmain/config.go +--- etcd-3.4.13/etcdmain/config.go.orig 2020-08-24 21:11:28.000000000 +0200 ++++ etcd-3.4.13/etcdmain/config.go 2020-09-04 00:12:28.424764763 +0200 @@ -123,14 +123,15 @@ func newConfig() *config { ), } @@ -55,7 +55,7 @@ diff -up etcd-3.4.3/etcdmain/config.go.orig etcd-3.4.3/etcdmain/config.go fs.StringVar(&cfg.ec.Logger, "logger", "capnslog", "Specify 'zap' for structured logging or 'capnslog'. WARN: 'capnslog' is being deprecated in v3.5.") fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-output", "[TO BE DEPRECATED IN v3.5] use '--log-outputs'.") fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-outputs", "Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd, or list of comma separated output targets.") -@@ -230,26 +231,26 @@ func newConfig() *config { +@@ -230,27 +231,27 @@ func newConfig() *config { fs.StringVar(&cfg.ec.LogLevel, "log-level", logutil.DefaultLogLevel, "Configures log level. Only supports debug, info, warn, error, panic, or fatal. Default 'info'.") fs.StringVar(&cfg.ec.LogPkgLevels, "log-package-levels", "", "[TO BE DEPRECATED IN v3.5] Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG').") @@ -77,6 +77,7 @@ diff -up etcd-3.4.3/etcdmain/config.go.orig etcd-3.4.3/etcdmain/config.go + fs.AddGroup("auth") fs.StringVar(&cfg.ec.AuthToken, "auth-token", cfg.ec.AuthToken, "Specify auth token specific options.") fs.UintVar(&cfg.ec.BcryptCost, "bcrypt-cost", cfg.ec.BcryptCost, "Specify bcrypt algorithm cost factor for auth password hashing.") + fs.UintVar(&cfg.ec.AuthTokenTTL, "auth-token-ttl", cfg.ec.AuthTokenTTL, "The lifetime in seconds of the auth token.") - // gateway + fs.AddGroup("gateway") @@ -87,23 +88,23 @@ diff -up etcd-3.4.3/etcdmain/config.go.orig etcd-3.4.3/etcdmain/config.go fs.BoolVar(&cfg.ec.ExperimentalInitialCorruptCheck, "experimental-initial-corrupt-check", cfg.ec.ExperimentalInitialCorruptCheck, "Enable to check data corruption before serving any client/peer traffic.") fs.DurationVar(&cfg.ec.ExperimentalCorruptCheckTime, "experimental-corrupt-check-time", cfg.ec.ExperimentalCorruptCheckTime, "Duration of time between cluster corruption check passes.") fs.StringVar(&cfg.ec.ExperimentalEnableV2V3, "experimental-enable-v2v3", cfg.ec.ExperimentalEnableV2V3, "v3 prefix for serving emulated v2 state.") -@@ -257,9 +258,12 @@ func newConfig() *config { - fs.BoolVar(&cfg.ec.ExperimentalEnableLeaseCheckpoint, "experimental-enable-lease-checkpoint", false, "Enable to persist lease remaining TTL to prevent indefinite auto-renewal of long lived leases.") +@@ -259,9 +260,12 @@ func newConfig() *config { fs.IntVar(&cfg.ec.ExperimentalCompactionBatchLimit, "experimental-compaction-batch-limit", cfg.ec.ExperimentalCompactionBatchLimit, "Sets the maximum revisions deleted in each compaction batch.") + fs.DurationVar(&cfg.ec.ExperimentalWatchProgressNotifyInterval, "experimental-watch-progress-notify-interval", cfg.ec.ExperimentalWatchProgressNotifyInterval, "Duration of periodic watch progress notifications.") - // unsafe + fs.AddGroup("unsafe") + fs.BoolVar(&cfg.ec.UnsafeNoFsync, "unsafe-no-fsync", false, "Disables fsync, unsafe, will cause data loss.") fs.BoolVar(&cfg.ec.ForceNewCluster, "force-new-cluster", false, "Force to create a new one member cluster.") - ++ + fs.GenMan() + os.Exit(0) -+ + // ignored for _, f := range cfg.ignored { - fs.Var(&flags.IgnoredFlag{Name: f}, f, "") -diff -up etcd-3.4.3/etcdmain/fake_flagset.go.orig etcd-3.4.3/etcdmain/fake_flagset.go ---- etcd-3.4.3/etcdmain/fake_flagset.go.orig 2020-02-06 01:14:12.639989665 +0100 -+++ etcd-3.4.3/etcdmain/fake_flagset.go 2020-02-06 01:14:12.639989665 +0100 +diff -up etcd-3.4.13/etcdmain/fake_flagset.go.orig etcd-3.4.13/etcdmain/fake_flagset.go +--- etcd-3.4.13/etcdmain/fake_flagset.go.orig 2020-09-04 00:10:11.223684457 +0200 ++++ etcd-3.4.13/etcdmain/fake_flagset.go 2020-09-04 00:10:11.223684457 +0200 @@ -0,0 +1,157 @@ +package etcdmain + diff --git a/0001-hack-to-generate-man-pages.patch b/0001-hack-to-generate-man-pages.patch index b77a849..37ea9cf 100644 --- a/0001-hack-to-generate-man-pages.patch +++ b/0001-hack-to-generate-man-pages.patch @@ -1,6 +1,6 @@ -diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go.hack2 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go ---- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go.hack2 2019-03-12 20:09:09.000000000 +0100 -+++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go 2019-03-14 20:20:04.887079104 +0100 +diff -up etcd-3.4.13/etcdctl/ctlv2/ctl.go.orig2 etcd-3.4.13/etcdctl/ctlv2/ctl.go +--- etcd-3.4.13/etcdctl/ctlv2/ctl.go.orig2 2020-08-24 21:11:28.000000000 +0200 ++++ etcd-3.4.13/etcdctl/ctlv2/ctl.go 2020-09-04 00:13:47.552811076 +0200 @@ -36,6 +36,68 @@ func Start() { } app.Usage = "A simple command line client for etcd." @@ -70,9 +70,9 @@ diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv2/ctl.go.hack app.Flags = []cli.Flag{ cli.BoolFlag{Name: "debug", Usage: "output cURL commands which can be used to reproduce the request"}, cli.BoolFlag{Name: "no-sync", Usage: "don't synchronize cluster information before sending request"}, -diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go.hack2 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go ---- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go.hack2 2019-03-14 20:20:04.888079103 +0100 -+++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.go 2019-03-14 20:32:35.376178988 +0100 +diff -up etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go.orig2 etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go +--- etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go.orig2 2020-08-24 21:11:28.000000000 +0200 ++++ etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go 2020-09-04 00:13:47.553811076 +0200 @@ -16,13 +16,20 @@ package ctlv3 @@ -97,9 +97,9 @@ diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/etcdctl/ctlv3/ctl_nocov.g + + cobra.GenManTree(rootCmd, header, "") } -diff -up etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go.hack2 etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go ---- etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go.hack2 2019-03-12 20:09:09.000000000 +0100 -+++ etcd-e1ca3b4434945e57e8e3a451cdbde74a903cc8e1/vendor/github.com/urfave/cli/flag.go 2019-03-14 20:20:04.883079109 +0100 +diff -up etcd-3.4.13/vendor/github.com/urfave/cli/flag.go.orig2 etcd-3.4.13/vendor/github.com/urfave/cli/flag.go +--- etcd-3.4.13/vendor/github.com/urfave/cli/flag.go.orig2 2020-08-24 21:11:28.000000000 +0200 ++++ etcd-3.4.13/vendor/github.com/urfave/cli/flag.go 2020-09-04 00:13:47.555811078 +0200 @@ -670,7 +670,7 @@ func prefixedNames(fullName, placeholder parts := strings.Split(fullName, ",") for i, name := range parts { diff --git a/etcd.spec b/etcd.spec index 3442b62..f7c5469 100644 --- a/etcd.spec +++ b/etcd.spec @@ -1,20 +1,25 @@ # Generated by go2rpm %bcond_without check +%bcond_without bootstrap + # https://github.com/etcd-io/etcd %global goipath go.etcd.io/etcd %global forgeurl https://github.com/etcd-io/etcd -Version: 3.4.7 +Version: 3.4.13 %gometa -# Remove in F33 -%global godevelheader %{expand: -Obsoletes: etcd-devel < 3.3.12-5 -} +%global goipaths0 go.etcd.io/etcd +%global goipathsex0 go.etcd.io/etcd/etcdserver/api/v3rpc/ + +%if %{without bootstrap} +%global goipaths1 go.etcd.io/etcd/etcdserver/api/v3rpc/ +%endif + %global goaltipaths github.com/coreos/etcd -%global man_version 3.4.7 +%global man_version 3.4.13 %global common_description %{expand: Distributed reliable key-value store for the most critical data of a distributed @@ -27,7 +32,7 @@ system.} %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Release: 3%{?dist} +Release: 1%{?dist} Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -42,8 +47,11 @@ Source10: genmanpages.sh # Not patches to apply here, but used on the source to generate man pages Source11: 0001-hack-etcdmain-to-generate-etcd.1.patch Source12: 0001-hack-to-generate-man-pages.patch -# Fix a test -Patch0: https://github.com/etcd-io/etcd/commit/2c95b49b63651ae3e0a3f63c45c05295d1af2c42.patch#/0001-remove-unknown-field-Etcd.Debug.patch +# Patch to work with latest grpc, highly experimental +# https://github.com/etcd-io/etcd/pull/12155 +Patch0: fix_for_latest_grpc.patch +# Go 1.15: https://github.com/golang/go/issues/32479 +Patch1: 0001-Convert-int-to-string-using-strconv.Itoa.patch BuildRequires: golang(github.com/bgentry/speakeasy) # BuildRequires: golang(github.com/cockroachdb/datadriven) @@ -60,7 +68,9 @@ BuildRequires: golang(github.com/golang/groupcache/lru) BuildRequires: golang(github.com/golang/protobuf/proto) BuildRequires: golang(github.com/google/btree) BuildRequires: golang(github.com/google/uuid) +%if %{without bootstrap} BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-middleware) +%endif BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-prometheus) BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/runtime) BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/utilities) @@ -94,7 +104,7 @@ BuildRequires: golang(google.golang.org/grpc/health) BuildRequires: golang(google.golang.org/grpc/health/grpc_health_v1) BuildRequires: golang(google.golang.org/grpc/keepalive) BuildRequires: golang(google.golang.org/grpc/metadata) -BuildRequires: golang(google.golang.org/grpc/naming) +# BuildRequires: golang(google.golang.org/grpc/naming) BuildRequires: golang(google.golang.org/grpc/peer) BuildRequires: golang(google.golang.org/grpc/resolver) BuildRequires: golang(google.golang.org/grpc/resolver/dns) @@ -122,8 +132,10 @@ BuildRequires: golang(github.com/prometheus/client_model/go) %prep %setup -q -n man-%{man_version} -T -b 3 -%goprep +%goprep -k %patch0 -p1 +%patch1 -p1 +rm -rf vendor/ rm -rf cmd/vendor rm -rf raft/rafttest # For compatibility @@ -139,17 +151,20 @@ mv etcdctl/READMEv2.md READMEv2-etcdctl.md mkdir -p man/man1 cp ../man-%{man_version}/*.1 man/man1/. +%if %{without bootstrap} %build %gobuild -o %{gobuilddir}/bin/etcd %{goipath} for cmd in etcdctl; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done +%endif # make -C docs help # make -C docs html %install %gopkginstall +%if %{without bootstrap} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ @@ -163,7 +178,9 @@ install -pm 644 man/man1/* %{buildroot}%{_mandir}/man1 # And create /var/lib/etcd install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} +%endif +%if %{without bootstrap} %if %{with check} %check %gocheck -d clientv3 \ @@ -184,7 +201,9 @@ install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} -t raft \ -t tests/e2e %endif +%endif +%if %{without bootstrap} %pre getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/%{name} \ @@ -208,10 +227,14 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %dir %attr(-,%{name},%{name}) %{_sharedstatedir}/%{name} %{_unitdir}/%{name}.service %{_mandir}/man1/*.1* +%endif %gopkgfiles %changelog +* Fri Sep 04 00:08:52 CEST 2020 Robert-André Mauchin - 3.4.13-1 +- Update to 3.4.13 + * Sat Aug 01 2020 Fedora Release Engineering - 3.4.7-3 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/fix_for_latest_grpc.patch b/fix_for_latest_grpc.patch new file mode 100644 index 0000000..b4cc65a --- /dev/null +++ b/fix_for_latest_grpc.patch @@ -0,0 +1,424 @@ +diff -up etcd-3.4.10/clientv3/balancer/balancer.go.orig2 etcd-3.4.10/clientv3/balancer/balancer.go +--- etcd-3.4.10/clientv3/balancer/balancer.go.orig2 2020-07-17 00:16:20.000000000 +0200 ++++ etcd-3.4.10/clientv3/balancer/balancer.go 2020-08-10 14:38:46.792286145 +0200 +@@ -138,13 +138,10 @@ type baseBalancer struct { + picker picker.Picker + } + +-// HandleResolvedAddrs implements "grpc/balancer.Balancer" interface. ++// UpdateClientConnState implements "grpc/balancer.Balancer" interface. + // gRPC sends initial or updated resolved addresses from "Build". +-func (bb *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) { +- if err != nil { +- bb.lg.Warn("HandleResolvedAddrs called with error", zap.String("balancer-id", bb.id), zap.Error(err)) +- return +- } ++func (bb *baseBalancer) UpdateClientConnState(state balancer.ClientConnState) error { ++ addrs := state.ResolverState.Addresses + bb.lg.Info("resolved", + zap.String("picker", bb.picker.String()), + zap.String("balancer-id", bb.id), +@@ -191,10 +188,20 @@ func (bb *baseBalancer) HandleResolvedAd + // (DO NOT) delete(bb.scToSt, sc) + } + } ++ ++ return nil + } + +-// HandleSubConnStateChange implements "grpc/balancer.Balancer" interface. +-func (bb *baseBalancer) HandleSubConnStateChange(sc balancer.SubConn, s grpcconnectivity.State) { ++// ResolverError implements "grpc/balancer.Balancer" interface. ++// It's called by gRPC when the name resolver reports an error. ++func (bb *baseBalancer) ResolverError(err error) { ++ bb.lg.Warn("ResolverError called with error", zap.String("balancer-id", bb.id), zap.Error(err)) ++} ++ ++// UpdateSubConnState implements "grpc/balancer.Balancer" interface. ++func (bb *baseBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { ++ s := state.ConnectivityState ++ + bb.mu.Lock() + defer bb.mu.Unlock() + +@@ -247,7 +254,10 @@ func (bb *baseBalancer) HandleSubConnSta + bb.updatePicker() + } + +- bb.currentConn.UpdateBalancerState(bb.connectivityRecorder.GetCurrentState(), bb.picker) ++ bb.currentConn.UpdateState(balancer.State{ ++ ConnectivityState: bb.connectivityRecorder.GetCurrentState(), ++ Picker: bb.picker, ++ }) + } + + func (bb *baseBalancer) updatePicker() { +diff -up etcd-3.4.10/clientv3/balancer/picker/err.go.orig2 etcd-3.4.10/clientv3/balancer/picker/err.go +--- etcd-3.4.10/clientv3/balancer/picker/err.go.orig2 2020-07-17 00:16:20.000000000 +0200 ++++ etcd-3.4.10/clientv3/balancer/picker/err.go 2020-08-10 14:38:46.793286144 +0200 +@@ -15,8 +15,6 @@ + package picker + + import ( +- "context" +- + "google.golang.org/grpc/balancer" + ) + +@@ -34,6 +32,6 @@ func (ep *errPicker) String() string { + return ep.p.String() + } + +-func (ep *errPicker) Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) { +- return nil, nil, ep.err ++func (ep *errPicker) Pick(_ balancer.PickInfo) (balancer.PickResult, error) { ++ return balancer.PickResult{}, ep.err + } +diff -up etcd-3.4.10/clientv3/balancer/picker/roundrobin_balanced.go.orig2 etcd-3.4.10/clientv3/balancer/picker/roundrobin_balanced.go +--- etcd-3.4.10/clientv3/balancer/picker/roundrobin_balanced.go.orig2 2020-07-17 00:16:20.000000000 +0200 ++++ etcd-3.4.10/clientv3/balancer/picker/roundrobin_balanced.go 2020-08-10 14:38:46.793286144 +0200 +@@ -15,7 +15,6 @@ + package picker + + import ( +- "context" + "sync" + + "go.uber.org/zap" +@@ -52,12 +51,12 @@ type rrBalanced struct { + func (rb *rrBalanced) String() string { return rb.p.String() } + + // Pick is called for every client request. +-func (rb *rrBalanced) Pick(ctx context.Context, opts balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) { ++func (rb *rrBalanced) Pick(_ balancer.PickInfo) (balancer.PickResult, error) { + rb.mu.RLock() + n := len(rb.scs) + rb.mu.RUnlock() + if n == 0 { +- return nil, nil, balancer.ErrNoSubConnAvailable ++ return balancer.PickResult{}, balancer.ErrNoSubConnAvailable + } + + rb.mu.Lock() +@@ -91,5 +90,9 @@ func (rb *rrBalanced) Pick(ctx context.C + rb.lg.Warn("balancer failed", fss...) + } + } +- return sc, doneFunc, nil ++ ++ return balancer.PickResult{ ++ SubConn: sc, ++ Done: doneFunc, ++ }, nil + } +diff -up etcd-3.4.10/clientv3/naming/grpc.go.orig2 etcd-3.4.10/clientv3/naming/grpc.go +--- etcd-3.4.10/clientv3/naming/grpc.go.orig2 2020-07-17 00:16:20.000000000 +0200 ++++ etcd-3.4.10/clientv3/naming/grpc.go 2020-08-10 14:40:02.425235180 +0200 +@@ -19,11 +19,10 @@ import ( + "encoding/json" + "fmt" + +- etcd "go.etcd.io/etcd/clientv3" +- + "google.golang.org/grpc/codes" +- "google.golang.org/grpc/naming" + "google.golang.org/grpc/status" ++ ++ etcd "go.etcd.io/etcd/clientv3" + ) + + var ErrWatcherClosed = fmt.Errorf("naming: watch closed") +@@ -34,15 +33,15 @@ type GRPCResolver struct { + Client *etcd.Client + } + +-func (gr *GRPCResolver) Update(ctx context.Context, target string, nm naming.Update, opts ...etcd.OpOption) (err error) { ++func (gr *GRPCResolver) Update(ctx context.Context, target string, nm Update, opts ...etcd.OpOption) (err error) { + switch nm.Op { +- case naming.Add: ++ case Add: + var v []byte + if v, err = json.Marshal(nm); err != nil { + return status.Error(codes.InvalidArgument, err.Error()) + } + _, err = gr.Client.KV.Put(ctx, target+"/"+nm.Addr, string(v), opts...) +- case naming.Delete: ++ case Delete: + _, err = gr.Client.Delete(ctx, target+"/"+nm.Addr, opts...) + default: + return status.Error(codes.InvalidArgument, "naming: bad naming op") +@@ -50,7 +49,7 @@ func (gr *GRPCResolver) Update(ctx conte + return err + } + +-func (gr *GRPCResolver) Resolve(target string) (naming.Watcher, error) { ++func (gr *GRPCResolver) Resolve(target string) (Watcher, error) { + ctx, cancel := context.WithCancel(context.Background()) + w := &gRPCWatcher{c: gr.Client, target: target + "/", ctx: ctx, cancel: cancel} + return w, nil +@@ -68,7 +67,7 @@ type gRPCWatcher struct { + // Next gets the next set of updates from the etcd resolver. + // Calls to Next should be serialized; concurrent calls are not safe since + // there is no way to reconcile the update ordering. +-func (gw *gRPCWatcher) Next() ([]*naming.Update, error) { ++func (gw *gRPCWatcher) Next() ([]*Update, error) { + if gw.wch == nil { + // first Next() returns all addresses + return gw.firstNext() +@@ -87,17 +86,17 @@ func (gw *gRPCWatcher) Next() ([]*naming + return nil, gw.err + } + +- updates := make([]*naming.Update, 0, len(wr.Events)) ++ updates := make([]*Update, 0, len(wr.Events)) + for _, e := range wr.Events { +- var jupdate naming.Update ++ var jupdate Update + var err error + switch e.Type { + case etcd.EventTypePut: + err = json.Unmarshal(e.Kv.Value, &jupdate) +- jupdate.Op = naming.Add ++ jupdate.Op = Add + case etcd.EventTypeDelete: + err = json.Unmarshal(e.PrevKv.Value, &jupdate) +- jupdate.Op = naming.Delete ++ jupdate.Op = Delete + default: + continue + } +@@ -108,7 +107,7 @@ func (gw *gRPCWatcher) Next() ([]*naming + return updates, nil + } + +-func (gw *gRPCWatcher) firstNext() ([]*naming.Update, error) { ++func (gw *gRPCWatcher) firstNext() ([]*Update, error) { + // Use serialized request so resolution still works if the target etcd + // server is partitioned away from the quorum. + resp, err := gw.c.Get(gw.ctx, gw.target, etcd.WithPrefix(), etcd.WithSerializable()) +@@ -116,9 +115,9 @@ func (gw *gRPCWatcher) firstNext() ([]*n + return nil, err + } + +- updates := make([]*naming.Update, 0, len(resp.Kvs)) ++ updates := make([]*Update, 0, len(resp.Kvs)) + for _, kv := range resp.Kvs { +- var jupdate naming.Update ++ var jupdate Update + if err := json.Unmarshal(kv.Value, &jupdate); err != nil { + continue + } +diff -up etcd-3.4.10/clientv3/naming/grpc_test.go.orig2 etcd-3.4.10/clientv3/naming/grpc_test.go +--- etcd-3.4.10/clientv3/naming/grpc_test.go.orig2 2020-07-17 00:16:20.000000000 +0200 ++++ etcd-3.4.10/clientv3/naming/grpc_test.go 2020-08-10 14:40:17.258223394 +0200 +@@ -23,8 +23,6 @@ import ( + etcd "go.etcd.io/etcd/clientv3" + "go.etcd.io/etcd/integration" + "go.etcd.io/etcd/pkg/testutil" +- +- "google.golang.org/grpc/naming" + ) + + func TestGRPCResolver(t *testing.T) { +@@ -43,7 +41,7 @@ func TestGRPCResolver(t *testing.T) { + } + defer w.Close() + +- addOp := naming.Update{Op: naming.Add, Addr: "127.0.0.1", Metadata: "metadata"} ++ addOp := Update{Op: Add, Addr: "127.0.0.1", Metadata: "metadata"} + err = r.Update(context.TODO(), "foo", addOp) + if err != nil { + t.Fatal("failed to add foo", err) +@@ -54,8 +52,8 @@ func TestGRPCResolver(t *testing.T) { + t.Fatal("failed to get udpate", err) + } + +- wu := &naming.Update{ +- Op: naming.Add, ++ wu := &Update{ ++ Op: Add, + Addr: "127.0.0.1", + Metadata: "metadata", + } +@@ -64,7 +62,7 @@ func TestGRPCResolver(t *testing.T) { + t.Fatalf("up = %#v, want %#v", us[0], wu) + } + +- delOp := naming.Update{Op: naming.Delete, Addr: "127.0.0.1"} ++ delOp := Update{Op: Delete, Addr: "127.0.0.1"} + err = r.Update(context.TODO(), "foo", delOp) + if err != nil { + t.Fatalf("failed to udpate %v", err) +@@ -75,8 +73,8 @@ func TestGRPCResolver(t *testing.T) { + t.Fatalf("failed to get udpate %v", err) + } + +- wu = &naming.Update{ +- Op: naming.Delete, ++ wu = &Update{ ++ Op: Delete, + Addr: "127.0.0.1", + Metadata: "metadata", + } +@@ -96,7 +94,7 @@ func TestGRPCResolverMulti(t *testing.T) + defer clus.Terminate(t) + c := clus.RandClient() + +- v, verr := json.Marshal(naming.Update{Addr: "127.0.0.1", Metadata: "md"}) ++ v, verr := json.Marshal(Update{Addr: "127.0.0.1", Metadata: "md"}) + if verr != nil { + t.Fatal(verr) + } +@@ -132,7 +130,7 @@ func TestGRPCResolverMulti(t *testing.T) + if nerr != nil { + t.Fatal(nerr) + } +- if len(updates) != 2 || (updates[0].Op != naming.Delete && updates[1].Op != naming.Delete) { ++ if len(updates) != 2 || (updates[0].Op != Delete && updates[1].Op != Delete) { + t.Fatalf("expected two updates, got %+v", updates) + } + } +diff -up etcd-3.4.10/clientv3/naming/naming.go.orig2 etcd-3.4.10/clientv3/naming/naming.go +--- etcd-3.4.10/clientv3/naming/naming.go.orig2 2020-08-10 14:38:46.805286136 +0200 ++++ etcd-3.4.10/clientv3/naming/naming.go 2020-08-10 14:38:46.798286141 +0200 +@@ -0,0 +1,48 @@ ++// Copyright 2020 The etcd and gRPC Authors ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++ ++// Package naming defines the naming API and related data structures for gRPC. ++package naming ++ ++// Operation defines the corresponding operations for a name resolution change. ++type Operation uint8 ++ ++const ( ++ // Add indicates a new address is added. ++ Add Operation = iota ++ // Delete indicates an existing address is deleted. ++ Delete ++) ++ ++// Update defines a name resolution update. Notice that it is not valid having both ++// empty string Addr and nil Metadata in an Update. ++type Update struct { ++ // Op indicates the operation of the update. ++ Op Operation ++ // Addr is the updated address. It is empty string if there is no address update. ++ Addr string ++ // Metadata is the updated metadata. It is nil if there is no metadata update. ++ // Metadata is not required for a custom naming implementation. ++ Metadata interface{} ++} ++ ++// Watcher watches for the updates on the specified target. ++type Watcher interface { ++ // Next blocks until an update or error happens. It may return one or more ++ // updates. The first call should get the full set of the results. It should ++ // return an error if and only if Watcher cannot recover. ++ Next() ([]*Update, error) ++ // Close closes the Watcher. ++ Close() ++} +diff -up etcd-3.4.10/proxy/grpcproxy/cluster.go.orig2 etcd-3.4.10/proxy/grpcproxy/cluster.go +--- etcd-3.4.10/proxy/grpcproxy/cluster.go.orig2 2020-07-17 00:16:20.000000000 +0200 ++++ etcd-3.4.10/proxy/grpcproxy/cluster.go 2020-08-10 14:38:46.802286138 +0200 +@@ -27,7 +27,6 @@ import ( + pb "go.etcd.io/etcd/etcdserver/etcdserverpb" + + "golang.org/x/time/rate" +- gnaming "google.golang.org/grpc/naming" + ) + + // allow maximum 1 retry per second +@@ -43,7 +42,7 @@ type clusterProxy struct { + prefix string + + umu sync.RWMutex +- umap map[string]gnaming.Update ++ umap map[string]naming.Update + } + + // NewClusterProxy takes optional prefix to fetch grpc-proxy member endpoints. +@@ -57,7 +56,7 @@ func NewClusterProxy(c *clientv3.Client, + + advaddr: advaddr, + prefix: prefix, +- umap: make(map[string]gnaming.Update), ++ umap: make(map[string]naming.Update), + } + + donec := make(chan struct{}) +@@ -85,7 +84,7 @@ func (cp *clusterProxy) resolve(prefix s + } + } + +-func (cp *clusterProxy) monitor(wa gnaming.Watcher) { ++func (cp *clusterProxy) monitor(wa naming.Watcher) { + for cp.ctx.Err() == nil { + ups, err := wa.Next() + if err != nil { +@@ -98,9 +97,9 @@ func (cp *clusterProxy) monitor(wa gnami + cp.umu.Lock() + for i := range ups { + switch ups[i].Op { +- case gnaming.Add: ++ case naming.Add: + cp.umap[ups[i].Addr] = *ups[i] +- case gnaming.Delete: ++ case naming.Delete: + delete(cp.umap, ups[i].Addr) + } + } +diff -up etcd-3.4.10/proxy/grpcproxy/register.go.orig2 etcd-3.4.10/proxy/grpcproxy/register.go +--- etcd-3.4.10/proxy/grpcproxy/register.go.orig2 2020-07-17 00:16:20.000000000 +0200 ++++ etcd-3.4.10/proxy/grpcproxy/register.go 2020-08-10 14:38:46.804286137 +0200 +@@ -23,7 +23,6 @@ import ( + "go.etcd.io/etcd/clientv3/naming" + + "golang.org/x/time/rate" +- gnaming "google.golang.org/grpc/naming" + ) + + // allow maximum 1 retry per second +@@ -68,7 +67,7 @@ func registerSession(c *clientv3.Client, + } + + gr := &naming.GRPCResolver{Client: c} +- if err = gr.Update(c.Ctx(), prefix, gnaming.Update{Op: gnaming.Add, Addr: addr, Metadata: getMeta()}, clientv3.WithLease(ss.Lease())); err != nil { ++ if err = gr.Update(c.Ctx(), prefix, naming.Update{Op: naming.Add, Addr: addr, Metadata: getMeta()}, clientv3.WithLease(ss.Lease())); err != nil { + return nil, err + } + +diff -up etcd-3.4.10/proxy/grpcproxy/register_test.go.orig2 etcd-3.4.10/proxy/grpcproxy/register_test.go +--- etcd-3.4.10/proxy/grpcproxy/register_test.go.orig2 2020-07-17 00:16:20.000000000 +0200 ++++ etcd-3.4.10/proxy/grpcproxy/register_test.go 2020-08-10 14:44:31.945142878 +0200 +@@ -22,8 +22,6 @@ import ( + "go.etcd.io/etcd/clientv3/naming" + "go.etcd.io/etcd/integration" + "go.etcd.io/etcd/pkg/testutil" +- +- gnaming "google.golang.org/grpc/naming" + ) + + func TestRegister(t *testing.T) { +@@ -66,7 +64,7 @@ func TestRegister(t *testing.T) { + } + } + +-func createWatcher(t *testing.T, c *clientv3.Client, prefix string) gnaming.Watcher { ++func createWatcher(t *testing.T, c *clientv3.Client, prefix string) naming.Watcher { + gr := &naming.GRPCResolver{Client: c} + watcher, err := gr.Resolve(prefix) + if err != nil { +diff -up etcd-3.4.10/vendor/google.golang.org/grpc/naming/naming.go.orig2 etcd-3.4.10/vendor/google.golang.org/grpc/naming/naming.go diff --git a/sources b/sources index b459fad..6edd075 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (etcd-3.4.7.tar.gz) = 18851be0cbe8dabc6be8ba0c61d783f21b1fb9403256166016767926c731f1d95a1adebad9f36d43c57a424a7ac88c49b1d1ce01c2aa065e5bbbff847eb9234a -SHA512 (man-3.4.7.tar.gz) = 702297c4bffcd27e73e2c9056761b1fc06892697805a9601c35ddc2ed553ef49bb4f75e943df21ecb246467050f4f814e0f85e9b62a115a04614819fec9709df +SHA512 (etcd-3.4.13.tar.gz) = a348e46f8f543bb43691cea20a7bfa0b1ef8b642dacc1dd26ee6f999cd5dc4aced19bb1606ba447293056674dbec7f043cbf959188a8b5cdf1f0de3d0938e08d +SHA512 (man-3.4.13.tar.gz) = 25a57f3a07ea05b340e5fa7463c38561ac330161954c07b9b7149d8bf789e3980094ca567498af6494422435bbc1ecc4a9a0e28f8af8178e21661ff6da7fee26 From 989809a30c4db628e75d494b2a72d252c0d917ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Fri, 4 Sep 2020 01:56:33 +0200 Subject: [PATCH 18/52] Unbootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- etcd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index f7c5469..0baea42 100644 --- a/etcd.spec +++ b/etcd.spec @@ -1,6 +1,6 @@ # Generated by go2rpm %bcond_without check -%bcond_without bootstrap +%bcond_with bootstrap # https://github.com/etcd-io/etcd From 73fc892b8b63fa98442a0347242fe64d24c63b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sat, 26 Dec 2020 18:03:42 +0100 Subject: [PATCH 19/52] Update to 3.4.14 Close: rhbz#1901781 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- .gitignore | 2 + 0001-update-grpc-go-version-to-v1.32.0.patch | 412 ++++++++++++++++++ etcd.spec | 18 +- fix_for_latest_grpc.patch | 424 ------------------- sources | 4 +- 5 files changed, 427 insertions(+), 433 deletions(-) create mode 100644 0001-update-grpc-go-version-to-v1.32.0.patch delete mode 100644 fix_for_latest_grpc.patch diff --git a/.gitignore b/.gitignore index d3ab0d7..241634c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ /man-3.4.7.tar.gz /etcd-3.4.13.tar.gz /man-3.4.13.tar.gz +/etcd-3.4.14.tar.gz +/man-3.4.14.tar.gz diff --git a/0001-update-grpc-go-version-to-v1.32.0.patch b/0001-update-grpc-go-version-to-v1.32.0.patch new file mode 100644 index 0000000..4c40ac0 --- /dev/null +++ b/0001-update-grpc-go-version-to-v1.32.0.patch @@ -0,0 +1,412 @@ +From 2859e9f94608b44c9c351c7ccfcff21665573627 Mon Sep 17 00:00:00 2001 +From: Sky Ao +Date: Thu, 15 Oct 2020 15:34:16 +0800 +Subject: [PATCH 1/4] update grpc-go version to v1.32.0 which has some breaking + api changes in naming and loadbalancer package + +--- + clientv3/balancer/balancer.go | 39 ++- + clientv3/balancer/picker/err.go | 6 +- + .../balancer/picker/roundrobin_balanced.go | 7 +- + clientv3/naming/grpc.go | 27 +- + clientv3/naming/grpcnaming/naming.go | 73 +++++ + proxy/grpcproxy/cluster.go | 2 +- + proxy/grpcproxy/register.go | 2 +- + 7 files changed, 424 insertions(+), 46 deletions(-) + create mode 100644 clientv3/naming/grpcnaming/naming.go + +diff --git a/clientv3/balancer/balancer.go b/clientv3/balancer/balancer.go +index 3eecb9d1d2..d3e672c632 100644 +--- a/clientv3/balancer/balancer.go ++++ b/clientv3/balancer/balancer.go +@@ -136,15 +136,34 @@ type baseBalancer struct { + connectivityRecorder connectivity.Recorder + + picker picker.Picker ++ ++ resolverErr error // the last error reported by the resolver; cleared on successful resolution + } + +-// HandleResolvedAddrs implements "grpc/balancer.Balancer" interface. +-// gRPC sends initial or updated resolved addresses from "Build". +-func (bb *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) { +- if err != nil { +- bb.lg.Warn("HandleResolvedAddrs called with error", zap.String("balancer-id", bb.id), zap.Error(err)) ++func (bb *baseBalancer) ResolverError(err error) { ++ bb.resolverErr = err ++ if len(bb.addrToSc) == 0 { ++ bb.connectivityRecorder.RecordTransition(bb.connectivityRecorder.GetCurrentState(), grpcconnectivity.TransientFailure) ++ } ++ ++ if bb.connectivityRecorder.GetCurrentState() != grpcconnectivity.TransientFailure { ++ // The picker will not change since the balancer does not currently ++ // report an error. + return + } ++ bb.updatePicker() ++ bb.currentConn.UpdateState(balancer.State{ ++ ConnectivityState: bb.connectivityRecorder.GetCurrentState(), ++ Picker: bb.picker, ++ }) ++} ++ ++// UpdateClientConnState implements "grpc/balancer.Balancer" interface. ++func (bb *baseBalancer) UpdateClientConnState(state balancer.ClientConnState) error { ++ addrs := state.ResolverState.Addresses ++ // Successful resolution; clear resolver error and ensure we return nil. ++ bb.resolverErr = nil ++ + bb.lg.Info("resolved", + zap.String("picker", bb.picker.String()), + zap.String("balancer-id", bb.id), +@@ -191,10 +210,14 @@ func (bb *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) + // (DO NOT) delete(bb.scToSt, sc) + } + } ++ ++ return nil + } + +-// HandleSubConnStateChange implements "grpc/balancer.Balancer" interface. +-func (bb *baseBalancer) HandleSubConnStateChange(sc balancer.SubConn, s grpcconnectivity.State) { ++// UpdateSubConnState implements "grpc/balancer.Balancer" interface. ++func (bb *baseBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { ++ s := state.ConnectivityState ++ + bb.mu.Lock() + defer bb.mu.Unlock() + +@@ -247,7 +270,7 @@ func (bb *baseBalancer) HandleSubConnStateChange(sc balancer.SubConn, s grpcconn + bb.updatePicker() + } + +- bb.currentConn.UpdateBalancerState(bb.connectivityRecorder.GetCurrentState(), bb.picker) ++ bb.currentConn.UpdateState(balancer.State{ConnectivityState: bb.connectivityRecorder.GetCurrentState(), Picker: bb.picker}) + } + + func (bb *baseBalancer) updatePicker() { +diff --git a/clientv3/balancer/picker/err.go b/clientv3/balancer/picker/err.go +index f4b941d652..a37baa7bd2 100644 +--- a/clientv3/balancer/picker/err.go ++++ b/clientv3/balancer/picker/err.go +@@ -15,8 +15,6 @@ + package picker + + import ( +- "context" +- + "google.golang.org/grpc/balancer" + ) + +@@ -34,6 +32,6 @@ func (ep *errPicker) String() string { + return ep.p.String() + } + +-func (ep *errPicker) Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) { +- return nil, nil, ep.err ++func (ep *errPicker) Pick(balancer.PickInfo) (balancer.PickResult, error) { ++ return balancer.PickResult{}, ep.err + } +diff --git a/clientv3/balancer/picker/roundrobin_balanced.go b/clientv3/balancer/picker/roundrobin_balanced.go +index e3971ecc42..993c05ec13 100644 +--- a/clientv3/balancer/picker/roundrobin_balanced.go ++++ b/clientv3/balancer/picker/roundrobin_balanced.go +@@ -15,7 +15,6 @@ + package picker + + import ( +- "context" + "sync" + + "go.uber.org/zap" +@@ -52,12 +51,12 @@ type rrBalanced struct { + func (rb *rrBalanced) String() string { return rb.p.String() } + + // Pick is called for every client request. +-func (rb *rrBalanced) Pick(ctx context.Context, opts balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) { ++func (rb *rrBalanced) Pick(opts balancer.PickInfo) (balancer.PickResult, error) { + rb.mu.RLock() + n := len(rb.scs) + rb.mu.RUnlock() + if n == 0 { +- return nil, nil, balancer.ErrNoSubConnAvailable ++ return balancer.PickResult{}, balancer.ErrNoSubConnAvailable + } + + rb.mu.Lock() +@@ -91,5 +90,5 @@ func (rb *rrBalanced) Pick(ctx context.Context, opts balancer.PickInfo) (balance + rb.lg.Warn("balancer failed", fss...) + } + } +- return sc, doneFunc, nil ++ return balancer.PickResult{SubConn: sc, Done: doneFunc}, nil + } +diff --git a/clientv3/naming/grpc.go b/clientv3/naming/grpc.go +index b680274bb3..f7cd2bd8a6 100644 +--- a/clientv3/naming/grpc.go ++++ b/clientv3/naming/grpc.go +@@ -20,9 +20,9 @@ import ( + "fmt" + + etcd "go.etcd.io/etcd/clientv3" ++ gnaming "go.etcd.io/etcd/clientv3/naming/grpcnaming" + + "google.golang.org/grpc/codes" +- "google.golang.org/grpc/naming" + "google.golang.org/grpc/status" + ) + +@@ -34,15 +33,15 @@ type GRPCResolver struct { + Client *etcd.Client + } + +-func (gr *GRPCResolver) Update(ctx context.Context, target string, nm naming.Update, opts ...etcd.OpOption) (err error) { ++func (gr *GRPCResolver) Update(ctx context.Context, target string, nm gnaming.Update, opts ...etcd.OpOption) (err error) { + switch nm.Op { +- case naming.Add: ++ case gnaming.Add: + var v []byte + if v, err = json.Marshal(nm); err != nil { + return status.Error(codes.InvalidArgument, err.Error()) + } + _, err = gr.Client.KV.Put(ctx, target+"/"+nm.Addr, string(v), opts...) +- case naming.Delete: ++ case gnaming.Delete: + _, err = gr.Client.Delete(ctx, target+"/"+nm.Addr, opts...) + default: + return status.Error(codes.InvalidArgument, "naming: bad naming op") +@@ -50,7 +49,7 @@ func (gr *GRPCResolver) Update(ctx context.Context, target string, nm naming.Upd + return err + } + +-func (gr *GRPCResolver) Resolve(target string) (naming.Watcher, error) { ++func (gr *GRPCResolver) Resolve(target string) (gnaming.Watcher, error) { + ctx, cancel := context.WithCancel(context.Background()) + w := &gRPCWatcher{c: gr.Client, target: target + "/", ctx: ctx, cancel: cancel} + return w, nil +@@ -68,7 +67,7 @@ type gRPCWatcher struct { + // Next gets the next set of updates from the etcd resolver. + // Calls to Next should be serialized; concurrent calls are not safe since + // there is no way to reconcile the update ordering. +-func (gw *gRPCWatcher) Next() ([]*naming.Update, error) { ++func (gw *gRPCWatcher) Next() ([]*gnaming.Update, error) { + if gw.wch == nil { + // first Next() returns all addresses + return gw.firstNext() +@@ -87,17 +86,17 @@ func (gw *gRPCWatcher) Next() ([]*naming.Update, error) { + return nil, gw.err + } + +- updates := make([]*naming.Update, 0, len(wr.Events)) ++ updates := make([]*gnaming.Update, 0, len(wr.Events)) + for _, e := range wr.Events { +- var jupdate naming.Update ++ var jupdate gnaming.Update + var err error + switch e.Type { + case etcd.EventTypePut: + err = json.Unmarshal(e.Kv.Value, &jupdate) +- jupdate.Op = naming.Add ++ jupdate.Op = gnaming.Add + case etcd.EventTypeDelete: + err = json.Unmarshal(e.PrevKv.Value, &jupdate) +- jupdate.Op = naming.Delete ++ jupdate.Op = gnaming.Delete + default: + continue + } +@@ -108,7 +107,7 @@ func (gw *gRPCWatcher) Next() ([]*naming.Update, error) { + return updates, nil + } + +-func (gw *gRPCWatcher) firstNext() ([]*naming.Update, error) { ++func (gw *gRPCWatcher) firstNext() ([]*gnaming.Update, error) { + // Use serialized request so resolution still works if the target etcd + // server is partitioned away from the quorum. + resp, err := gw.c.Get(gw.ctx, gw.target, etcd.WithPrefix(), etcd.WithSerializable()) +@@ -116,9 +115,9 @@ func (gw *gRPCWatcher) firstNext() ([]*naming.Update, error) { + return nil, err + } + +- updates := make([]*naming.Update, 0, len(resp.Kvs)) ++ updates := make([]*gnaming.Update, 0, len(resp.Kvs)) + for _, kv := range resp.Kvs { +- var jupdate naming.Update ++ var jupdate gnaming.Update + if err := json.Unmarshal(kv.Value, &jupdate); err != nil { + continue + } +diff --git a/clientv3/naming/grpcnaming/naming.go b/clientv3/naming/grpcnaming/naming.go +new file mode 100644 +index 0000000000..9b1f20cc61 +--- /dev/null ++++ b/clientv3/naming/grpcnaming/naming.go +@@ -0,0 +1,73 @@ ++/* ++ * ++ * Copyright 2014 gRPC authors. ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ * ++ */ ++ ++// Package naming defines the naming API and related data structures for gRPC. ++// ++// This package is deprecated: please use package resolver instead. ++ ++ ++// Notice: this file is a copy of naming/naming.go from grpc-go v1.29.1. ++// The package of grpc naming is removed since grpc-go v1.30.0. ++// This is a work around to make etcd work with grpc new version (>=v1.30.0) without too many code change. ++package grpcnaming ++ ++// Operation defines the corresponding operations for a name resolution change. ++// ++// Deprecated: please use package resolver. ++type Operation uint8 ++ ++const ( ++ // Add indicates a new address is added. ++ Add Operation = iota ++ // Delete indicates an existing address is deleted. ++ Delete ++) ++ ++// Update defines a name resolution update. Notice that it is not valid having both ++// empty string Addr and nil Metadata in an Update. ++// ++// Deprecated: please use package resolver. ++type Update struct { ++ // Op indicates the operation of the update. ++ Op Operation ++ // Addr is the updated address. It is empty string if there is no address update. ++ Addr string ++ // Metadata is the updated metadata. It is nil if there is no metadata update. ++ // Metadata is not required for a custom naming implementation. ++ Metadata interface{} ++} ++ ++// Resolver creates a Watcher for a target to track its resolution changes. ++// ++// Deprecated: please use package resolver. ++type Resolver interface { ++ // Resolve creates a Watcher for target. ++ Resolve(target string) (Watcher, error) ++} ++ ++// Watcher watches for the updates on the specified target. ++// ++// Deprecated: please use package resolver. ++type Watcher interface { ++ // Next blocks until an update or error happens. It may return one or more ++ // updates. The first call should get the full set of the results. It should ++ // return an error if and only if Watcher cannot recover. ++ Next() ([]*Update, error) ++ // Close closes the Watcher. ++ Close() ++} +\ No newline at end of file +diff --git a/proxy/grpcproxy/cluster.go b/proxy/grpcproxy/cluster.go +index 5f3ab76584..a786457a6a 100644 +--- a/proxy/grpcproxy/cluster.go ++++ b/proxy/grpcproxy/cluster.go +@@ -18,6 +18,7 @@ import ( + "context" + "errors" + "fmt" ++ gnaming "go.etcd.io/etcd/clientv3/naming/grpcnaming" + "os" + "sync" + +@@ -27,7 +28,6 @@ import ( + pb "go.etcd.io/etcd/etcdserver/etcdserverpb" + + "golang.org/x/time/rate" +- gnaming "google.golang.org/grpc/naming" + ) + + // allow maximum 1 retry per second +diff --git a/proxy/grpcproxy/register.go b/proxy/grpcproxy/register.go +index e74cd5ca90..912e147d77 100644 +--- a/proxy/grpcproxy/register.go ++++ b/proxy/grpcproxy/register.go +@@ -16,6 +16,7 @@ package grpcproxy + + import ( + "encoding/json" ++ gnaming "go.etcd.io/etcd/clientv3/naming/grpcnaming" + "os" + + "go.etcd.io/etcd/clientv3" +@@ -23,7 +24,6 @@ import ( + "go.etcd.io/etcd/clientv3/naming" + + "golang.org/x/time/rate" +- gnaming "google.golang.org/grpc/naming" + ) + + // allow maximum 1 retry per second +From b1d600ee05737adf6fc2ba3a5c3d92c1037bb6a6 Mon Sep 17 00:00:00 2001 +From: Sky Ao +Date: Thu, 22 Oct 2020 11:20:17 +0800 +Subject: [PATCH 3/4] add doc for method ResolveError() + +--- + clientv3/balancer/balancer.go | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/clientv3/balancer/balancer.go b/clientv3/balancer/balancer.go +index d3e672c632..1488580331 100644 +--- a/clientv3/balancer/balancer.go ++++ b/clientv3/balancer/balancer.go +@@ -140,6 +140,7 @@ type baseBalancer struct { + resolverErr error // the last error reported by the resolver; cleared on successful resolution + } + ++// ResolverError implements "grpc/balancer.Balancer" interface. + func (bb *baseBalancer) ResolverError(err error) { + bb.resolverErr = err + if len(bb.addrToSc) == 0 { + +From 5ba58f2283eda7247f51b4e9dd07c367c4d77235 Mon Sep 17 00:00:00 2001 +From: Sky Ao +Date: Thu, 22 Oct 2020 11:36:03 +0800 +Subject: [PATCH 4/4] update to pass fmt checking + +--- + clientv3/naming/grpcnaming/naming.go | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/clientv3/naming/grpcnaming/naming.go b/clientv3/naming/grpcnaming/naming.go +index 9b1f20cc61..a4415a6541 100644 +--- a/clientv3/naming/grpcnaming/naming.go ++++ b/clientv3/naming/grpcnaming/naming.go +@@ -19,11 +19,6 @@ + // Package naming defines the naming API and related data structures for gRPC. + // + // This package is deprecated: please use package resolver instead. +- +- +-// Notice: this file is a copy of naming/naming.go from grpc-go v1.29.1. +-// The package of grpc naming is removed since grpc-go v1.30.0. +-// This is a work around to make etcd work with grpc new version (>=v1.30.0) without too many code change. + package grpcnaming + + // Operation defines the corresponding operations for a name resolution change. +@@ -70,4 +65,4 @@ type Watcher interface { + Next() ([]*Update, error) + // Close closes the Watcher. + Close() +-} +\ No newline at end of file ++} diff --git a/etcd.spec b/etcd.spec index 0baea42..475c818 100644 --- a/etcd.spec +++ b/etcd.spec @@ -6,7 +6,7 @@ # https://github.com/etcd-io/etcd %global goipath go.etcd.io/etcd %global forgeurl https://github.com/etcd-io/etcd -Version: 3.4.13 +Version: 3.4.14 %gometa @@ -18,8 +18,8 @@ Version: 3.4.13 %endif -%global goaltipaths github.com/coreos/etcd -%global man_version 3.4.13 +%global goaltipaths github.com/coreos/etcd go.etcd.io/etcd/v3 +%global man_version 3.4.14 %global common_description %{expand: Distributed reliable key-value store for the most critical data of a distributed @@ -47,10 +47,8 @@ Source10: genmanpages.sh # Not patches to apply here, but used on the source to generate man pages Source11: 0001-hack-etcdmain-to-generate-etcd.1.patch Source12: 0001-hack-to-generate-man-pages.patch -# Patch to work with latest grpc, highly experimental -# https://github.com/etcd-io/etcd/pull/12155 -Patch0: fix_for_latest_grpc.patch -# Go 1.15: https://github.com/golang/go/issues/32479 +# update grpc-go version to v1.32.0 +Patch0: 0001-update-grpc-go-version-to-v1.32.0.patch Patch1: 0001-Convert-int-to-string-using-strconv.Itoa.patch BuildRequires: golang(github.com/bgentry/speakeasy) @@ -191,6 +189,7 @@ install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} -d integration \ -d clientv3/integration \ -d clientv3/balancer \ + -d clientv3/naming \ -d clientv3/snapshot \ -d clientv3/ordering \ -d pkg/expect \ @@ -198,6 +197,7 @@ install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} -d pkg/proxy \ -d pkg/tlsutil \ -d pkg/transport \ + -d proxy/grpcproxy \ -t raft \ -t tests/e2e %endif @@ -232,6 +232,10 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %gopkgfiles %changelog +* Sat Dec 26 16:38:31 CET 2020 Robert-André Mauchin - 3.4.14-1 +- Update to 3.4.14 +- Close: rhbz#1901781 + * Fri Sep 04 00:08:52 CEST 2020 Robert-André Mauchin - 3.4.13-1 - Update to 3.4.13 diff --git a/fix_for_latest_grpc.patch b/fix_for_latest_grpc.patch deleted file mode 100644 index b4cc65a..0000000 --- a/fix_for_latest_grpc.patch +++ /dev/null @@ -1,424 +0,0 @@ -diff -up etcd-3.4.10/clientv3/balancer/balancer.go.orig2 etcd-3.4.10/clientv3/balancer/balancer.go ---- etcd-3.4.10/clientv3/balancer/balancer.go.orig2 2020-07-17 00:16:20.000000000 +0200 -+++ etcd-3.4.10/clientv3/balancer/balancer.go 2020-08-10 14:38:46.792286145 +0200 -@@ -138,13 +138,10 @@ type baseBalancer struct { - picker picker.Picker - } - --// HandleResolvedAddrs implements "grpc/balancer.Balancer" interface. -+// UpdateClientConnState implements "grpc/balancer.Balancer" interface. - // gRPC sends initial or updated resolved addresses from "Build". --func (bb *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) { -- if err != nil { -- bb.lg.Warn("HandleResolvedAddrs called with error", zap.String("balancer-id", bb.id), zap.Error(err)) -- return -- } -+func (bb *baseBalancer) UpdateClientConnState(state balancer.ClientConnState) error { -+ addrs := state.ResolverState.Addresses - bb.lg.Info("resolved", - zap.String("picker", bb.picker.String()), - zap.String("balancer-id", bb.id), -@@ -191,10 +188,20 @@ func (bb *baseBalancer) HandleResolvedAd - // (DO NOT) delete(bb.scToSt, sc) - } - } -+ -+ return nil - } - --// HandleSubConnStateChange implements "grpc/balancer.Balancer" interface. --func (bb *baseBalancer) HandleSubConnStateChange(sc balancer.SubConn, s grpcconnectivity.State) { -+// ResolverError implements "grpc/balancer.Balancer" interface. -+// It's called by gRPC when the name resolver reports an error. -+func (bb *baseBalancer) ResolverError(err error) { -+ bb.lg.Warn("ResolverError called with error", zap.String("balancer-id", bb.id), zap.Error(err)) -+} -+ -+// UpdateSubConnState implements "grpc/balancer.Balancer" interface. -+func (bb *baseBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { -+ s := state.ConnectivityState -+ - bb.mu.Lock() - defer bb.mu.Unlock() - -@@ -247,7 +254,10 @@ func (bb *baseBalancer) HandleSubConnSta - bb.updatePicker() - } - -- bb.currentConn.UpdateBalancerState(bb.connectivityRecorder.GetCurrentState(), bb.picker) -+ bb.currentConn.UpdateState(balancer.State{ -+ ConnectivityState: bb.connectivityRecorder.GetCurrentState(), -+ Picker: bb.picker, -+ }) - } - - func (bb *baseBalancer) updatePicker() { -diff -up etcd-3.4.10/clientv3/balancer/picker/err.go.orig2 etcd-3.4.10/clientv3/balancer/picker/err.go ---- etcd-3.4.10/clientv3/balancer/picker/err.go.orig2 2020-07-17 00:16:20.000000000 +0200 -+++ etcd-3.4.10/clientv3/balancer/picker/err.go 2020-08-10 14:38:46.793286144 +0200 -@@ -15,8 +15,6 @@ - package picker - - import ( -- "context" -- - "google.golang.org/grpc/balancer" - ) - -@@ -34,6 +32,6 @@ func (ep *errPicker) String() string { - return ep.p.String() - } - --func (ep *errPicker) Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) { -- return nil, nil, ep.err -+func (ep *errPicker) Pick(_ balancer.PickInfo) (balancer.PickResult, error) { -+ return balancer.PickResult{}, ep.err - } -diff -up etcd-3.4.10/clientv3/balancer/picker/roundrobin_balanced.go.orig2 etcd-3.4.10/clientv3/balancer/picker/roundrobin_balanced.go ---- etcd-3.4.10/clientv3/balancer/picker/roundrobin_balanced.go.orig2 2020-07-17 00:16:20.000000000 +0200 -+++ etcd-3.4.10/clientv3/balancer/picker/roundrobin_balanced.go 2020-08-10 14:38:46.793286144 +0200 -@@ -15,7 +15,6 @@ - package picker - - import ( -- "context" - "sync" - - "go.uber.org/zap" -@@ -52,12 +51,12 @@ type rrBalanced struct { - func (rb *rrBalanced) String() string { return rb.p.String() } - - // Pick is called for every client request. --func (rb *rrBalanced) Pick(ctx context.Context, opts balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) { -+func (rb *rrBalanced) Pick(_ balancer.PickInfo) (balancer.PickResult, error) { - rb.mu.RLock() - n := len(rb.scs) - rb.mu.RUnlock() - if n == 0 { -- return nil, nil, balancer.ErrNoSubConnAvailable -+ return balancer.PickResult{}, balancer.ErrNoSubConnAvailable - } - - rb.mu.Lock() -@@ -91,5 +90,9 @@ func (rb *rrBalanced) Pick(ctx context.C - rb.lg.Warn("balancer failed", fss...) - } - } -- return sc, doneFunc, nil -+ -+ return balancer.PickResult{ -+ SubConn: sc, -+ Done: doneFunc, -+ }, nil - } -diff -up etcd-3.4.10/clientv3/naming/grpc.go.orig2 etcd-3.4.10/clientv3/naming/grpc.go ---- etcd-3.4.10/clientv3/naming/grpc.go.orig2 2020-07-17 00:16:20.000000000 +0200 -+++ etcd-3.4.10/clientv3/naming/grpc.go 2020-08-10 14:40:02.425235180 +0200 -@@ -19,11 +19,10 @@ import ( - "encoding/json" - "fmt" - -- etcd "go.etcd.io/etcd/clientv3" -- - "google.golang.org/grpc/codes" -- "google.golang.org/grpc/naming" - "google.golang.org/grpc/status" -+ -+ etcd "go.etcd.io/etcd/clientv3" - ) - - var ErrWatcherClosed = fmt.Errorf("naming: watch closed") -@@ -34,15 +33,15 @@ type GRPCResolver struct { - Client *etcd.Client - } - --func (gr *GRPCResolver) Update(ctx context.Context, target string, nm naming.Update, opts ...etcd.OpOption) (err error) { -+func (gr *GRPCResolver) Update(ctx context.Context, target string, nm Update, opts ...etcd.OpOption) (err error) { - switch nm.Op { -- case naming.Add: -+ case Add: - var v []byte - if v, err = json.Marshal(nm); err != nil { - return status.Error(codes.InvalidArgument, err.Error()) - } - _, err = gr.Client.KV.Put(ctx, target+"/"+nm.Addr, string(v), opts...) -- case naming.Delete: -+ case Delete: - _, err = gr.Client.Delete(ctx, target+"/"+nm.Addr, opts...) - default: - return status.Error(codes.InvalidArgument, "naming: bad naming op") -@@ -50,7 +49,7 @@ func (gr *GRPCResolver) Update(ctx conte - return err - } - --func (gr *GRPCResolver) Resolve(target string) (naming.Watcher, error) { -+func (gr *GRPCResolver) Resolve(target string) (Watcher, error) { - ctx, cancel := context.WithCancel(context.Background()) - w := &gRPCWatcher{c: gr.Client, target: target + "/", ctx: ctx, cancel: cancel} - return w, nil -@@ -68,7 +67,7 @@ type gRPCWatcher struct { - // Next gets the next set of updates from the etcd resolver. - // Calls to Next should be serialized; concurrent calls are not safe since - // there is no way to reconcile the update ordering. --func (gw *gRPCWatcher) Next() ([]*naming.Update, error) { -+func (gw *gRPCWatcher) Next() ([]*Update, error) { - if gw.wch == nil { - // first Next() returns all addresses - return gw.firstNext() -@@ -87,17 +86,17 @@ func (gw *gRPCWatcher) Next() ([]*naming - return nil, gw.err - } - -- updates := make([]*naming.Update, 0, len(wr.Events)) -+ updates := make([]*Update, 0, len(wr.Events)) - for _, e := range wr.Events { -- var jupdate naming.Update -+ var jupdate Update - var err error - switch e.Type { - case etcd.EventTypePut: - err = json.Unmarshal(e.Kv.Value, &jupdate) -- jupdate.Op = naming.Add -+ jupdate.Op = Add - case etcd.EventTypeDelete: - err = json.Unmarshal(e.PrevKv.Value, &jupdate) -- jupdate.Op = naming.Delete -+ jupdate.Op = Delete - default: - continue - } -@@ -108,7 +107,7 @@ func (gw *gRPCWatcher) Next() ([]*naming - return updates, nil - } - --func (gw *gRPCWatcher) firstNext() ([]*naming.Update, error) { -+func (gw *gRPCWatcher) firstNext() ([]*Update, error) { - // Use serialized request so resolution still works if the target etcd - // server is partitioned away from the quorum. - resp, err := gw.c.Get(gw.ctx, gw.target, etcd.WithPrefix(), etcd.WithSerializable()) -@@ -116,9 +115,9 @@ func (gw *gRPCWatcher) firstNext() ([]*n - return nil, err - } - -- updates := make([]*naming.Update, 0, len(resp.Kvs)) -+ updates := make([]*Update, 0, len(resp.Kvs)) - for _, kv := range resp.Kvs { -- var jupdate naming.Update -+ var jupdate Update - if err := json.Unmarshal(kv.Value, &jupdate); err != nil { - continue - } -diff -up etcd-3.4.10/clientv3/naming/grpc_test.go.orig2 etcd-3.4.10/clientv3/naming/grpc_test.go ---- etcd-3.4.10/clientv3/naming/grpc_test.go.orig2 2020-07-17 00:16:20.000000000 +0200 -+++ etcd-3.4.10/clientv3/naming/grpc_test.go 2020-08-10 14:40:17.258223394 +0200 -@@ -23,8 +23,6 @@ import ( - etcd "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/integration" - "go.etcd.io/etcd/pkg/testutil" -- -- "google.golang.org/grpc/naming" - ) - - func TestGRPCResolver(t *testing.T) { -@@ -43,7 +41,7 @@ func TestGRPCResolver(t *testing.T) { - } - defer w.Close() - -- addOp := naming.Update{Op: naming.Add, Addr: "127.0.0.1", Metadata: "metadata"} -+ addOp := Update{Op: Add, Addr: "127.0.0.1", Metadata: "metadata"} - err = r.Update(context.TODO(), "foo", addOp) - if err != nil { - t.Fatal("failed to add foo", err) -@@ -54,8 +52,8 @@ func TestGRPCResolver(t *testing.T) { - t.Fatal("failed to get udpate", err) - } - -- wu := &naming.Update{ -- Op: naming.Add, -+ wu := &Update{ -+ Op: Add, - Addr: "127.0.0.1", - Metadata: "metadata", - } -@@ -64,7 +62,7 @@ func TestGRPCResolver(t *testing.T) { - t.Fatalf("up = %#v, want %#v", us[0], wu) - } - -- delOp := naming.Update{Op: naming.Delete, Addr: "127.0.0.1"} -+ delOp := Update{Op: Delete, Addr: "127.0.0.1"} - err = r.Update(context.TODO(), "foo", delOp) - if err != nil { - t.Fatalf("failed to udpate %v", err) -@@ -75,8 +73,8 @@ func TestGRPCResolver(t *testing.T) { - t.Fatalf("failed to get udpate %v", err) - } - -- wu = &naming.Update{ -- Op: naming.Delete, -+ wu = &Update{ -+ Op: Delete, - Addr: "127.0.0.1", - Metadata: "metadata", - } -@@ -96,7 +94,7 @@ func TestGRPCResolverMulti(t *testing.T) - defer clus.Terminate(t) - c := clus.RandClient() - -- v, verr := json.Marshal(naming.Update{Addr: "127.0.0.1", Metadata: "md"}) -+ v, verr := json.Marshal(Update{Addr: "127.0.0.1", Metadata: "md"}) - if verr != nil { - t.Fatal(verr) - } -@@ -132,7 +130,7 @@ func TestGRPCResolverMulti(t *testing.T) - if nerr != nil { - t.Fatal(nerr) - } -- if len(updates) != 2 || (updates[0].Op != naming.Delete && updates[1].Op != naming.Delete) { -+ if len(updates) != 2 || (updates[0].Op != Delete && updates[1].Op != Delete) { - t.Fatalf("expected two updates, got %+v", updates) - } - } -diff -up etcd-3.4.10/clientv3/naming/naming.go.orig2 etcd-3.4.10/clientv3/naming/naming.go ---- etcd-3.4.10/clientv3/naming/naming.go.orig2 2020-08-10 14:38:46.805286136 +0200 -+++ etcd-3.4.10/clientv3/naming/naming.go 2020-08-10 14:38:46.798286141 +0200 -@@ -0,0 +1,48 @@ -+// Copyright 2020 The etcd and gRPC Authors -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+ -+// Package naming defines the naming API and related data structures for gRPC. -+package naming -+ -+// Operation defines the corresponding operations for a name resolution change. -+type Operation uint8 -+ -+const ( -+ // Add indicates a new address is added. -+ Add Operation = iota -+ // Delete indicates an existing address is deleted. -+ Delete -+) -+ -+// Update defines a name resolution update. Notice that it is not valid having both -+// empty string Addr and nil Metadata in an Update. -+type Update struct { -+ // Op indicates the operation of the update. -+ Op Operation -+ // Addr is the updated address. It is empty string if there is no address update. -+ Addr string -+ // Metadata is the updated metadata. It is nil if there is no metadata update. -+ // Metadata is not required for a custom naming implementation. -+ Metadata interface{} -+} -+ -+// Watcher watches for the updates on the specified target. -+type Watcher interface { -+ // Next blocks until an update or error happens. It may return one or more -+ // updates. The first call should get the full set of the results. It should -+ // return an error if and only if Watcher cannot recover. -+ Next() ([]*Update, error) -+ // Close closes the Watcher. -+ Close() -+} -diff -up etcd-3.4.10/proxy/grpcproxy/cluster.go.orig2 etcd-3.4.10/proxy/grpcproxy/cluster.go ---- etcd-3.4.10/proxy/grpcproxy/cluster.go.orig2 2020-07-17 00:16:20.000000000 +0200 -+++ etcd-3.4.10/proxy/grpcproxy/cluster.go 2020-08-10 14:38:46.802286138 +0200 -@@ -27,7 +27,6 @@ import ( - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" - - "golang.org/x/time/rate" -- gnaming "google.golang.org/grpc/naming" - ) - - // allow maximum 1 retry per second -@@ -43,7 +42,7 @@ type clusterProxy struct { - prefix string - - umu sync.RWMutex -- umap map[string]gnaming.Update -+ umap map[string]naming.Update - } - - // NewClusterProxy takes optional prefix to fetch grpc-proxy member endpoints. -@@ -57,7 +56,7 @@ func NewClusterProxy(c *clientv3.Client, - - advaddr: advaddr, - prefix: prefix, -- umap: make(map[string]gnaming.Update), -+ umap: make(map[string]naming.Update), - } - - donec := make(chan struct{}) -@@ -85,7 +84,7 @@ func (cp *clusterProxy) resolve(prefix s - } - } - --func (cp *clusterProxy) monitor(wa gnaming.Watcher) { -+func (cp *clusterProxy) monitor(wa naming.Watcher) { - for cp.ctx.Err() == nil { - ups, err := wa.Next() - if err != nil { -@@ -98,9 +97,9 @@ func (cp *clusterProxy) monitor(wa gnami - cp.umu.Lock() - for i := range ups { - switch ups[i].Op { -- case gnaming.Add: -+ case naming.Add: - cp.umap[ups[i].Addr] = *ups[i] -- case gnaming.Delete: -+ case naming.Delete: - delete(cp.umap, ups[i].Addr) - } - } -diff -up etcd-3.4.10/proxy/grpcproxy/register.go.orig2 etcd-3.4.10/proxy/grpcproxy/register.go ---- etcd-3.4.10/proxy/grpcproxy/register.go.orig2 2020-07-17 00:16:20.000000000 +0200 -+++ etcd-3.4.10/proxy/grpcproxy/register.go 2020-08-10 14:38:46.804286137 +0200 -@@ -23,7 +23,6 @@ import ( - "go.etcd.io/etcd/clientv3/naming" - - "golang.org/x/time/rate" -- gnaming "google.golang.org/grpc/naming" - ) - - // allow maximum 1 retry per second -@@ -68,7 +67,7 @@ func registerSession(c *clientv3.Client, - } - - gr := &naming.GRPCResolver{Client: c} -- if err = gr.Update(c.Ctx(), prefix, gnaming.Update{Op: gnaming.Add, Addr: addr, Metadata: getMeta()}, clientv3.WithLease(ss.Lease())); err != nil { -+ if err = gr.Update(c.Ctx(), prefix, naming.Update{Op: naming.Add, Addr: addr, Metadata: getMeta()}, clientv3.WithLease(ss.Lease())); err != nil { - return nil, err - } - -diff -up etcd-3.4.10/proxy/grpcproxy/register_test.go.orig2 etcd-3.4.10/proxy/grpcproxy/register_test.go ---- etcd-3.4.10/proxy/grpcproxy/register_test.go.orig2 2020-07-17 00:16:20.000000000 +0200 -+++ etcd-3.4.10/proxy/grpcproxy/register_test.go 2020-08-10 14:44:31.945142878 +0200 -@@ -22,8 +22,6 @@ import ( - "go.etcd.io/etcd/clientv3/naming" - "go.etcd.io/etcd/integration" - "go.etcd.io/etcd/pkg/testutil" -- -- gnaming "google.golang.org/grpc/naming" - ) - - func TestRegister(t *testing.T) { -@@ -66,7 +64,7 @@ func TestRegister(t *testing.T) { - } - } - --func createWatcher(t *testing.T, c *clientv3.Client, prefix string) gnaming.Watcher { -+func createWatcher(t *testing.T, c *clientv3.Client, prefix string) naming.Watcher { - gr := &naming.GRPCResolver{Client: c} - watcher, err := gr.Resolve(prefix) - if err != nil { -diff -up etcd-3.4.10/vendor/google.golang.org/grpc/naming/naming.go.orig2 etcd-3.4.10/vendor/google.golang.org/grpc/naming/naming.go diff --git a/sources b/sources index 6edd075..0653d96 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (etcd-3.4.13.tar.gz) = a348e46f8f543bb43691cea20a7bfa0b1ef8b642dacc1dd26ee6f999cd5dc4aced19bb1606ba447293056674dbec7f043cbf959188a8b5cdf1f0de3d0938e08d -SHA512 (man-3.4.13.tar.gz) = 25a57f3a07ea05b340e5fa7463c38561ac330161954c07b9b7149d8bf789e3980094ca567498af6494422435bbc1ecc4a9a0e28f8af8178e21661ff6da7fee26 +SHA512 (etcd-3.4.14.tar.gz) = 61262b921104f4626131f9722a127debe7b1daac09a90fcb55fb044312b771024e913eb657ea0c59a64b493f66a07f828bcc109afadbd4cc5981034a778f3958 +SHA512 (man-3.4.14.tar.gz) = 7f1223d0891d043a8d8df2e6b5071155ffa907f7fdcde2b4ad927929917e019c1b5c8f86b240441d3eed8ac3889870d856423a699c1308bd552a579b71a5b652 From ef50a93336e03d30522e1cea2b49ed7d2b8838cc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 05:01:56 +0000 Subject: [PATCH 20/52] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- etcd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index 475c818..f5bdc3a 100644 --- a/etcd.spec +++ b/etcd.spec @@ -32,7 +32,7 @@ system.} %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -232,6 +232,9 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %gopkgfiles %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 3.4.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Sat Dec 26 16:38:31 CET 2020 Robert-André Mauchin - 3.4.14-1 - Update to 3.4.14 - Close: rhbz#1901781 From 5701beadc5a5f391fdc3b393e1241f32272cfd77 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 21 Jul 2021 22:26:18 +0000 Subject: [PATCH 21/52] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- etcd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index f5bdc3a..7dcea02 100644 --- a/etcd.spec +++ b/etcd.spec @@ -32,7 +32,7 @@ system.} %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Release: 2%{?dist} +Release: 3%{?dist} Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -232,6 +232,9 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %gopkgfiles %changelog +* Wed Jul 21 2021 Fedora Release Engineering - 3.4.14-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Tue Jan 26 2021 Fedora Release Engineering - 3.4.14-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 6dbd97aea6fd0fd721a0b8de63ae282bba9dd9c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Thu, 5 Aug 2021 15:16:40 +0200 Subject: [PATCH 22/52] Convert to rpmautospec --- changelog | 426 +++++++++++++++++++++++++++++++++++++++++++++++++++++ etcd.spec | 429 +----------------------------------------------------- 2 files changed, 428 insertions(+), 427 deletions(-) create mode 100644 changelog diff --git a/changelog b/changelog new file mode 100644 index 0000000..a8233a2 --- /dev/null +++ b/changelog @@ -0,0 +1,426 @@ +* Wed Jul 21 2021 Fedora Release Engineering - 3.4.14-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 3.4.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sat Dec 26 16:38:31 CET 2020 Robert-André Mauchin - 3.4.14-1 +- Update to 3.4.14 +- Close: rhbz#1901781 + +* Fri Sep 04 00:08:52 CEST 2020 Robert-André Mauchin - 3.4.13-1 +- Update to 3.4.13 + +* Sat Aug 01 2020 Fedora Release Engineering - 3.4.7-3 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 3.4.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sun Apr 05 15:36:23 CEST 2020 Robert-André Mauchin - 3.4.7-1 +- Update to 3.4.7 + +* Mon Feb 17 2020 Elliott Sales de Andrade - 3.3.13-5 +- Rebuilt for GHSA-jf24-p9p9-4rjh + +* Tue Jan 28 2020 Fedora Release Engineering - 3.3.13-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jul 24 2019 Fedora Release Engineering - 3.3.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Jul 10 2019 Elliott Sales de Andrade - 3.3.13-2 +- Add Obsoletes for old name + +* Wed May 08 01:20:48 CEST 2019 Robert-André Mauchin - 3.3.13-1 +- Release 3.3.13 + +* Tue Apr 16 15:51:11 CET 2019 Robert-André Mauchin - 3.3.12-4.20190413gitf29b1ad +- etcd.service: do not pass command line flags already defined in environment + +* Mon Apr 15 15:11:24 CET 2019 Robert-André Mauchin - 3.3.12-3.20190413gitf29b1ad +- Fix building of etcd + +* Sat Apr 13 22:31:30 CET 2019 Robert-André Mauchin - 3.3.12-2.20190413gitf29b1ad +- Bump to commit f29b1ada19713544b698dab8c94c97cfa1e83dac + +* Thu Mar 14 2019 Robert-André Mauchin - 3.3.12-1.20190314gite1ca3b4 +- Bump to commit e1ca3b4434945e57e8e3a451cdbde74a903cc8e1 +- Add new goipath +- Updated patches +- Updated man pages + +* Sun Feb 17 2019 Elliott Sales de Andrade - 3.2.16-6 +- Fix broken version specification +- Backport variadic parameter fix + +* Thu Jan 31 2019 Fedora Release Engineering - 3.2.16-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Oct 23 2018 Nicolas Mailhot - 3.2.16-4 +- redhat-rpm-config-123 triggers bugs in gosetup, remove it from Go spec files as it’s just an alias +- https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/RWD5YATAYAFWKIDZBB7EB6N5DAO4ZKFM/ + +* Fri Jul 13 2018 Fedora Release Engineering - 3.2.16-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Mar 20 2018 Jan Chaloupka - 3.2.16-2 +- Put back the missing prep, post, preun and postun scripts + resolves: #1557356 + +* Fri Mar 09 2018 Jan Chaloupka - 3.2.16-1.git121edf0 +- Update to 3.2.16 + +* Tue Mar 06 2018 Jan Chaloupka - 3.2.7-5.gitbb66589 +- Update to spec 3.0 + +* Wed Feb 07 2018 Fedora Release Engineering - 3.2.7-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Nov 30 2017 Jan Chaloupka - 3.2.7-3 +- Polish the spec file + +* Tue Nov 07 2017 Jan Chaloupka - 3.2.7-2 +- Generate man pages + +* Sun Sep 24 2017 Jan Chaloupka - 3.2.7-1 +- Update to 3.2.7 + related: #1448611 + +* Tue Aug 15 2017 Jan Chaloupka - 3.2.5-1 +- Update to 3.2.5 + resolves: #1448611 + +* Wed Aug 02 2017 Fedora Release Engineering - 3.1.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 3.1.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sun Jun 11 2017 Jan Chaloupka - 3.1.9-1 +- Update to 3.1.9 + resolves: #1460496 + +* Mon Jun 05 2017 Jan Chaloupka - 3.1.8-1 + Update to 3.1.8 + resolves: #1458717 + +* Tue May 02 2017 Jan Chaloupka - 3.1.7-1 +- Update to 3.1.7 + resolves: #1447232 + +* Thu Apr 20 2017 Jan Chaloupka - 3.1.6-1 +- Update to 3.1.6 + resolves: #1444068 + +* Tue Mar 28 2017 Jan Chaloupka - 3.1.5-1 +- Update to 3.1.5 + resolves: #1436452 + +* Mon Mar 27 2017 Jan Chaloupka - 3.1.4-1 +- Update to 3.1.4 + resolves: #1435028 + +* Mon Mar 20 2017 Jan Chaloupka - 3.1.3-1 +- Update to v3.1.3 + related: #1415341 + +* Tue Mar 14 2017 Jan Chaloupka - 3.1.0-1 +- Update to v3.1.0 + related: #1415341 + +* Fri Feb 10 2017 Fedora Release Engineering - 3.0.17-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Jan 23 2017 Jan Chaloupka - 3.0.17-1 +- Update to v3.0.17 + etcd-top removed by upstream + resolves: #1415622 + +* Fri Nov 18 2016 jchaloup - 3.0.15-2 +- Remove ppc64le architecture restriction + resolves: #1396463 + +* Tue Nov 15 2016 jchaloup - 3.0.15-1 +- Update to v3.0.15 + related: #1382965 + +* Mon Nov 07 2016 jchaloup - 3.0.14-1 +- Update to v3.0.14 + related: #1382965 + +* Thu Oct 27 2016 jchaloup - 3.0.13-1 +- Update to v3.0.13 + related: #1382965 + +* Mon Oct 24 2016 jchaloup - 3.0.12-2 +- Extend supported architectures with s390x + +* Thu Oct 13 2016 jchaloup - 3.0.12-1 +- Update to v3.0.12 + related: #1382965 + +* Fri Sep 16 2016 jchaloup - 3.0.9-1 +- Update to v3.0.9 + related: #1374880 + +* Wed Sep 14 2016 jchaloup - 3.0.8-1 +- Update to v3.0.8 + resolves: #1374880 + +* Fri Sep 09 2016 jchaloup - 3.0.7-1 +- Update to v3.0.7 + resolves: #1370678 + +* Tue Aug 16 2016 jchaloup - 3.0.4-2 +- Hack test to provide ability to run unit-tests and integration tests + Still, keeping it disabled by default as it keeps failing + related: #1351818 + +* Tue Aug 02 2016 jchaloup - 3.0.4-1 +- Update to 3.0.4 + related: #1351818 + +* Thu Jul 28 2016 jchaloup - 3.0.2-1 +- Update to 3.0.2 + resolves: #1351818 + +* Thu Jul 21 2016 Fedora Release Engineering - 3.0.0-0.2.beta0 +- https://fedoraproject.org/wiki/Changes/golang1.7 + +* Sun May 15 2016 jchaloup - 3.0.0-0.1.beta0 +- Update to v3.0.0-beta0 (build from bundled until new deps appear in dist-git) + resolves: #1333988 + +* Sat Apr 30 2016 jchaloup - 2.3.3-1 +- Update to v2.3.3 + resolves: #1331896 + +* Fri Apr 22 2016 jchaloup - 2.3.2-1 +- Update to v2.3.2 + resolves: #1329438 + +* Sat Apr 9 2016 Peter Robinson 2.3.1-3 +- Enable aarch64 + +* Wed Apr 06 2016 jchaloup - 2.3.1-2 +- Don't apply patch (for tests only which are disabled atm) + +* Mon Apr 04 2016 jchaloup - 2.3.1-1 +- Update to v.2.3.1 + resolves: #1323375 + +* Sun Mar 20 2016 jchaloup - 2.3.0-1 +- Update to v2.3.0 + resolves: #1314441 + +* Wed Mar 09 2016 jchaloup - 2.2.5-4 +- Only ppc64le is supported, ppc64 not + related: #1315419 + +* Tue Mar 08 2016 jchaloup - 2.2.5-3 +- Extend archs to all supported + resolves: #1315419 + +* Mon Feb 22 2016 Fedora Release Engineering - 2.2.5-2 +- https://fedoraproject.org/wiki/Changes/golang1.6 + +* Thu Feb 18 2016 jchaloup - 2.2.5-1 +- Update to v2.2.5 + +* Wed Feb 03 2016 Fedora Release Engineering - 2.2.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jan 21 2016 jchaloup - 2.2.4-1 +- Update to v2.2.4 + resolves: #1300558 + +* Fri Jan 08 2016 jchaloup - 2.2.3-1 +- Update to v2.2.3 + resolves: #1296809 + +* Tue Dec 29 2015 jchaloup - 2.2.2-2 +- add missing options to etcd help (thanks to Joy Pu ypu@redhat.com) +- add more information when running etcd as a service + +* Mon Dec 07 2015 jchaloup - 2.2.2-1 +- Update to v2.2.2 + +* Mon Nov 16 2015 jchaloup - 2.2.1-4 +- Update etcd.conf: add new options, fix current + +* Fri Oct 30 2015 jchaloup - 2.2.1-3 +- Add After=network-online.target and Wants=network-online.target + to etcd.service + +* Tue Oct 20 2015 jchaloup - 2.2.1-2 +- Set Type=notify instead of simple in etcd.service (upstream #1576) + related: #1272438 + +* Fri Oct 16 2015 jchaloup - 2.2.1-1 +- Update to v2.2.1 + resolves: #1272438 + +* Fri Sep 11 2015 jchaloup - 2.2.0-1 +- Update to v2.2.0 (etcd-migrate gone) +- Update to spec-2.1 + resolves: #1253864 + +* Mon Aug 31 2015 jchaloup - 2.1.2-1 +- Update to v2.1.2 + resolves: #1258599 + +* Thu Jul 30 2015 jchaloup - 2.1.1-2 +- Enable debug info again + related: #1214958 + +* Mon Jul 20 2015 jchaloup - 2.1.1-1 +- fix definition of GOPATH for go1.5 +- fix definition of gobuild function for non-debug way +- Update to v2.1.1 + resolves: #1214958 + +* Fri Jul 10 2015 jchaloup - 2.0.13-3 +- set GOMAXPROCS to use all processors available + +* Mon Jun 29 2015 jchaloup - 2.0.13-2 +- Remove -s option from -ldflags string as it removes symbol table + 'go tool l6' gives explanation of all available options + resolves: #1236320 + +* Fri Jun 26 2015 jchaloup - 2.0.13-1 +- Update to v2.0.13 + +* Thu Jun 25 2015 jchaloup - 2.0.12-2 +- Add restart policy and set LimitNOFILE to/in etcd.service file +- Update etcd.config file: add new flags and remove depricated +- Update 'go build' flags for GIT_SHA (used in build script) +- Don't use 4001 and 7001 ports in etcd.conf, they are replaced with 2379 and 2380 + +* Wed Jun 24 2015 jchaloup - 2.0.12-1 +- Update to v2.0.12 +- Polish spec file + +* Wed Jun 17 2015 Fedora Release Engineering - 2.0.11-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri May 22 2015 jchaloup - 2.0.11-2 +- ETCD_ADVERTISE_CLIENT_URLS has to be set if ETCD_LISTEN_CLIENT_URLS is + related: #1222416 + +* Mon May 18 2015 jchaloup - 2.0.11-1 +- Update to v2.0.11 + resolves: #1222416 + +* Thu Apr 23 2015 jchaloup - 2.0.10-1 +- Update to v2.0.10 + resolves: #1214705 + +* Wed Apr 08 2015 jchaloup - 2.0.9-1 +- Update to v2.0.9 + resolves: #1209666 + +* Fri Apr 03 2015 jchaloup - 2.0.8-0.2 +- Update spec file to fit for rhel too (thanks to eparis) + related: #1207881 + +* Wed Apr 01 2015 jchaloup - 2.0.8-0.1 +- Update to v2.0.8 + resolves: #1207881 + +* Tue Mar 31 2015 jchaloup - 2.0.7-0.1 +- Update to v2.0.7 + Add Godeps.json to doc + related: #1191441 + +* Thu Mar 12 2015 jchaloup - 2.0.5-0.1 +- Bump to 9481945228b97c5d019596b921d8b03833964d9e (v2.0.5) + +* Tue Mar 10 2015 Eric Paris - 2.0.3-0.2 +- Fix .service files to work if no config file + +* Fri Feb 20 2015 jchaloup - 2.0.3-0.1 +- Bump to upstream 4d728cc8c488a545a8bdeafd054d9ccc2bfb6876 + +* Wed Feb 18 2015 jchaloup - 2.0.1-0.2 +- Update configuration and service file + Fix depricated ErrWrongType after update of gogo/protobuf + related: #1191441 + +* Wed Feb 11 2015 jchaloup - 2.0.1-0.1 +- Update to 2.0.1 + resolves: #1191441 + +* Mon Feb 09 2015 jchaloup - 2.0.0-0.5 +- Add missing debug info to binaries (patch from Jan Kratochvil) + resolves: #1184257 + +* Fri Jan 30 2015 jchaloup - 2.0.0-0.4 +- Update to etcd-2.0.0 +- use gopath as the last directory to search for source code + related: #1176138 + +* Mon Jan 26 2015 jchaloup - 2.0.0-0.3.rc1 +- default to /var/lib/etcd/default.etcd as 2.0 uses that default (f21 commit byt eparis) + related: #1176138 + fix /etc/etcd/etcd.conf path + +* Tue Jan 20 2015 jchaloup - 2.0.0-0.2.rc1 +- Update of BuildRequires/Requires, Provides and test + Add BuildRequire on jonboulle/clockwork + related: #1176138 + +* Tue Dec 23 2014 Lokesh Mandvekar - 2.0.0-0.1.rc1 +- Resolves: rhbz#1176138 - update to v2.0.0-rc1 +- do not redefine gopath +- use jonboulle/clockwork from within Godeps + +* Fri Oct 17 2014 jchaloup - 0.4.6-7 +- Add ExclusiveArch for go_arches + +* Mon Oct 06 2014 jchaloup - 0.4.6-6 +- related: #1047194 + Remove dependency on go.net + +* Mon Oct 06 2014 jchaloup - 0.4.6-5 +- Fix the .service file so it can launch! + related: #1047194 + +* Mon Sep 22 2014 jchaloup - 0.4.6-4 +- resolves: #1047194 + Update to 0.4.6 from https://github.com/projectatomic/etcd-package + +* Tue Aug 19 2014 Adam Miller - 0.4.6-3 +- Add devel sub-package + +* Wed Aug 13 2014 Eric Paris - 0.4.6-2 +- Bump to 0.4.6 +- run as etcd, not root + +* Sat Jun 07 2014 Fedora Release Engineering - 0.1.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sun Oct 20 2013 Peter Lemenkov - 0.1.2-5 +- goprotobuf library unbundled (see rhbz #1018477) +- go-log library unbundled (see rhbz #1018478) +- go-raft library unbundled (see rhbz #1018479) +- go-systemd library unbundled (see rhbz #1018480) +- kardianos library unbundled (see rhbz #1018481) + +* Sun Oct 13 2013 Peter Lemenkov - 0.1.2-4 +- go.net library unbundled (see rhbz #1018476) + +* Sat Oct 12 2013 Peter Lemenkov - 0.1.2-3 +- Prepare for packages unbundling +- Verbose build + +* Sat Oct 12 2013 Peter Lemenkov - 0.1.2-2 +- Fix typo in the etc.service file + +* Sat Oct 12 2013 Peter Lemenkov - 0.1.2-1 +- Ver. 0.1.2 +- Integrate with systemd + +* Mon Aug 26 2013 Luke Cypret - 0.1.1-1 +- Initial creation diff --git a/etcd.spec b/etcd.spec index 7dcea02..7748442 100644 --- a/etcd.spec +++ b/etcd.spec @@ -32,7 +32,7 @@ system.} %global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* Name: etcd -Release: 3%{?dist} +Release: %autorelease Summary: Distributed reliable key-value store for the most critical data of a distributed system # Upstream license specification: Apache-2.0 @@ -232,429 +232,4 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %gopkgfiles %changelog -* Wed Jul 21 2021 Fedora Release Engineering - 3.4.14-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Tue Jan 26 2021 Fedora Release Engineering - 3.4.14-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Sat Dec 26 16:38:31 CET 2020 Robert-André Mauchin - 3.4.14-1 -- Update to 3.4.14 -- Close: rhbz#1901781 - -* Fri Sep 04 00:08:52 CEST 2020 Robert-André Mauchin - 3.4.13-1 -- Update to 3.4.13 - -* Sat Aug 01 2020 Fedora Release Engineering - 3.4.7-3 -- Second attempt - Rebuilt for - https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Mon Jul 27 2020 Fedora Release Engineering - 3.4.7-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Sun Apr 05 15:36:23 CEST 2020 Robert-André Mauchin - 3.4.7-1 -- Update to 3.4.7 - -* Mon Feb 17 2020 Elliott Sales de Andrade - 3.3.13-5 -- Rebuilt for GHSA-jf24-p9p9-4rjh - -* Tue Jan 28 2020 Fedora Release Engineering - 3.3.13-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Wed Jul 24 2019 Fedora Release Engineering - 3.3.13-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Wed Jul 10 2019 Elliott Sales de Andrade - 3.3.13-2 -- Add Obsoletes for old name - -* Wed May 08 01:20:48 CEST 2019 Robert-André Mauchin - 3.3.13-1 -- Release 3.3.13 - -* Tue Apr 16 15:51:11 CET 2019 Robert-André Mauchin - 3.3.12-4.20190413gitf29b1ad -- etcd.service: do not pass command line flags already defined in environment - -* Mon Apr 15 15:11:24 CET 2019 Robert-André Mauchin - 3.3.12-3.20190413gitf29b1ad -- Fix building of etcd - -* Sat Apr 13 22:31:30 CET 2019 Robert-André Mauchin - 3.3.12-2.20190413gitf29b1ad -- Bump to commit f29b1ada19713544b698dab8c94c97cfa1e83dac - -* Thu Mar 14 2019 Robert-André Mauchin - 3.3.12-1.20190314gite1ca3b4 -- Bump to commit e1ca3b4434945e57e8e3a451cdbde74a903cc8e1 -- Add new goipath -- Updated patches -- Updated man pages - -* Sun Feb 17 2019 Elliott Sales de Andrade - 3.2.16-6 -- Fix broken version specification -- Backport variadic parameter fix - -* Thu Jan 31 2019 Fedora Release Engineering - 3.2.16-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Tue Oct 23 2018 Nicolas Mailhot - 3.2.16-4 -- redhat-rpm-config-123 triggers bugs in gosetup, remove it from Go spec files as it’s just an alias -- https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/RWD5YATAYAFWKIDZBB7EB6N5DAO4ZKFM/ - -* Fri Jul 13 2018 Fedora Release Engineering - 3.2.16-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Tue Mar 20 2018 Jan Chaloupka - 3.2.16-2 -- Put back the missing prep, post, preun and postun scripts - resolves: #1557356 - -* Fri Mar 09 2018 Jan Chaloupka - 3.2.16-1.git121edf0 -- Update to 3.2.16 - -* Tue Mar 06 2018 Jan Chaloupka - 3.2.7-5.gitbb66589 -- Update to spec 3.0 - -* Wed Feb 07 2018 Fedora Release Engineering - 3.2.7-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Thu Nov 30 2017 Jan Chaloupka - 3.2.7-3 -- Polish the spec file - -* Tue Nov 07 2017 Jan Chaloupka - 3.2.7-2 -- Generate man pages - -* Sun Sep 24 2017 Jan Chaloupka - 3.2.7-1 -- Update to 3.2.7 - related: #1448611 - -* Tue Aug 15 2017 Jan Chaloupka - 3.2.5-1 -- Update to 3.2.5 - resolves: #1448611 - -* Wed Aug 02 2017 Fedora Release Engineering - 3.1.9-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Wed Jul 26 2017 Fedora Release Engineering - 3.1.9-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Sun Jun 11 2017 Jan Chaloupka - 3.1.9-1 -- Update to 3.1.9 - resolves: #1460496 - -* Mon Jun 05 2017 Jan Chaloupka - 3.1.8-1 - Update to 3.1.8 - resolves: #1458717 - -* Tue May 02 2017 Jan Chaloupka - 3.1.7-1 -- Update to 3.1.7 - resolves: #1447232 - -* Thu Apr 20 2017 Jan Chaloupka - 3.1.6-1 -- Update to 3.1.6 - resolves: #1444068 - -* Tue Mar 28 2017 Jan Chaloupka - 3.1.5-1 -- Update to 3.1.5 - resolves: #1436452 - -* Mon Mar 27 2017 Jan Chaloupka - 3.1.4-1 -- Update to 3.1.4 - resolves: #1435028 - -* Mon Mar 20 2017 Jan Chaloupka - 3.1.3-1 -- Update to v3.1.3 - related: #1415341 - -* Tue Mar 14 2017 Jan Chaloupka - 3.1.0-1 -- Update to v3.1.0 - related: #1415341 - -* Fri Feb 10 2017 Fedora Release Engineering - 3.0.17-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Mon Jan 23 2017 Jan Chaloupka - 3.0.17-1 -- Update to v3.0.17 - etcd-top removed by upstream - resolves: #1415622 - -* Fri Nov 18 2016 jchaloup - 3.0.15-2 -- Remove ppc64le architecture restriction - resolves: #1396463 - -* Tue Nov 15 2016 jchaloup - 3.0.15-1 -- Update to v3.0.15 - related: #1382965 - -* Mon Nov 07 2016 jchaloup - 3.0.14-1 -- Update to v3.0.14 - related: #1382965 - -* Thu Oct 27 2016 jchaloup - 3.0.13-1 -- Update to v3.0.13 - related: #1382965 - -* Mon Oct 24 2016 jchaloup - 3.0.12-2 -- Extend supported architectures with s390x - -* Thu Oct 13 2016 jchaloup - 3.0.12-1 -- Update to v3.0.12 - related: #1382965 - -* Fri Sep 16 2016 jchaloup - 3.0.9-1 -- Update to v3.0.9 - related: #1374880 - -* Wed Sep 14 2016 jchaloup - 3.0.8-1 -- Update to v3.0.8 - resolves: #1374880 - -* Fri Sep 09 2016 jchaloup - 3.0.7-1 -- Update to v3.0.7 - resolves: #1370678 - -* Tue Aug 16 2016 jchaloup - 3.0.4-2 -- Hack test to provide ability to run unit-tests and integration tests - Still, keeping it disabled by default as it keeps failing - related: #1351818 - -* Tue Aug 02 2016 jchaloup - 3.0.4-1 -- Update to 3.0.4 - related: #1351818 - -* Thu Jul 28 2016 jchaloup - 3.0.2-1 -- Update to 3.0.2 - resolves: #1351818 - -* Thu Jul 21 2016 Fedora Release Engineering - 3.0.0-0.2.beta0 -- https://fedoraproject.org/wiki/Changes/golang1.7 - -* Sun May 15 2016 jchaloup - 3.0.0-0.1.beta0 -- Update to v3.0.0-beta0 (build from bundled until new deps appear in dist-git) - resolves: #1333988 - -* Sat Apr 30 2016 jchaloup - 2.3.3-1 -- Update to v2.3.3 - resolves: #1331896 - -* Fri Apr 22 2016 jchaloup - 2.3.2-1 -- Update to v2.3.2 - resolves: #1329438 - -* Sat Apr 9 2016 Peter Robinson 2.3.1-3 -- Enable aarch64 - -* Wed Apr 06 2016 jchaloup - 2.3.1-2 -- Don't apply patch (for tests only which are disabled atm) - -* Mon Apr 04 2016 jchaloup - 2.3.1-1 -- Update to v.2.3.1 - resolves: #1323375 - -* Sun Mar 20 2016 jchaloup - 2.3.0-1 -- Update to v2.3.0 - resolves: #1314441 - -* Wed Mar 09 2016 jchaloup - 2.2.5-4 -- Only ppc64le is supported, ppc64 not - related: #1315419 - -* Tue Mar 08 2016 jchaloup - 2.2.5-3 -- Extend archs to all supported - resolves: #1315419 - -* Mon Feb 22 2016 Fedora Release Engineering - 2.2.5-2 -- https://fedoraproject.org/wiki/Changes/golang1.6 - -* Thu Feb 18 2016 jchaloup - 2.2.5-1 -- Update to v2.2.5 - -* Wed Feb 03 2016 Fedora Release Engineering - 2.2.4-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Thu Jan 21 2016 jchaloup - 2.2.4-1 -- Update to v2.2.4 - resolves: #1300558 - -* Fri Jan 08 2016 jchaloup - 2.2.3-1 -- Update to v2.2.3 - resolves: #1296809 - -* Tue Dec 29 2015 jchaloup - 2.2.2-2 -- add missing options to etcd help (thanks to Joy Pu ypu@redhat.com) -- add more information when running etcd as a service - -* Mon Dec 07 2015 jchaloup - 2.2.2-1 -- Update to v2.2.2 - -* Mon Nov 16 2015 jchaloup - 2.2.1-4 -- Update etcd.conf: add new options, fix current - -* Fri Oct 30 2015 jchaloup - 2.2.1-3 -- Add After=network-online.target and Wants=network-online.target - to etcd.service - -* Tue Oct 20 2015 jchaloup - 2.2.1-2 -- Set Type=notify instead of simple in etcd.service (upstream #1576) - related: #1272438 - -* Fri Oct 16 2015 jchaloup - 2.2.1-1 -- Update to v2.2.1 - resolves: #1272438 - -* Fri Sep 11 2015 jchaloup - 2.2.0-1 -- Update to v2.2.0 (etcd-migrate gone) -- Update to spec-2.1 - resolves: #1253864 - -* Mon Aug 31 2015 jchaloup - 2.1.2-1 -- Update to v2.1.2 - resolves: #1258599 - -* Thu Jul 30 2015 jchaloup - 2.1.1-2 -- Enable debug info again - related: #1214958 - -* Mon Jul 20 2015 jchaloup - 2.1.1-1 -- fix definition of GOPATH for go1.5 -- fix definition of gobuild function for non-debug way -- Update to v2.1.1 - resolves: #1214958 - -* Fri Jul 10 2015 jchaloup - 2.0.13-3 -- set GOMAXPROCS to use all processors available - -* Mon Jun 29 2015 jchaloup - 2.0.13-2 -- Remove -s option from -ldflags string as it removes symbol table - 'go tool l6' gives explanation of all available options - resolves: #1236320 - -* Fri Jun 26 2015 jchaloup - 2.0.13-1 -- Update to v2.0.13 - -* Thu Jun 25 2015 jchaloup - 2.0.12-2 -- Add restart policy and set LimitNOFILE to/in etcd.service file -- Update etcd.config file: add new flags and remove depricated -- Update 'go build' flags for GIT_SHA (used in build script) -- Don't use 4001 and 7001 ports in etcd.conf, they are replaced with 2379 and 2380 - -* Wed Jun 24 2015 jchaloup - 2.0.12-1 -- Update to v2.0.12 -- Polish spec file - -* Wed Jun 17 2015 Fedora Release Engineering - 2.0.11-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Fri May 22 2015 jchaloup - 2.0.11-2 -- ETCD_ADVERTISE_CLIENT_URLS has to be set if ETCD_LISTEN_CLIENT_URLS is - related: #1222416 - -* Mon May 18 2015 jchaloup - 2.0.11-1 -- Update to v2.0.11 - resolves: #1222416 - -* Thu Apr 23 2015 jchaloup - 2.0.10-1 -- Update to v2.0.10 - resolves: #1214705 - -* Wed Apr 08 2015 jchaloup - 2.0.9-1 -- Update to v2.0.9 - resolves: #1209666 - -* Fri Apr 03 2015 jchaloup - 2.0.8-0.2 -- Update spec file to fit for rhel too (thanks to eparis) - related: #1207881 - -* Wed Apr 01 2015 jchaloup - 2.0.8-0.1 -- Update to v2.0.8 - resolves: #1207881 - -* Tue Mar 31 2015 jchaloup - 2.0.7-0.1 -- Update to v2.0.7 - Add Godeps.json to doc - related: #1191441 - -* Thu Mar 12 2015 jchaloup - 2.0.5-0.1 -- Bump to 9481945228b97c5d019596b921d8b03833964d9e (v2.0.5) - -* Tue Mar 10 2015 Eric Paris - 2.0.3-0.2 -- Fix .service files to work if no config file - -* Fri Feb 20 2015 jchaloup - 2.0.3-0.1 -- Bump to upstream 4d728cc8c488a545a8bdeafd054d9ccc2bfb6876 - -* Wed Feb 18 2015 jchaloup - 2.0.1-0.2 -- Update configuration and service file - Fix depricated ErrWrongType after update of gogo/protobuf - related: #1191441 - -* Wed Feb 11 2015 jchaloup - 2.0.1-0.1 -- Update to 2.0.1 - resolves: #1191441 - -* Mon Feb 09 2015 jchaloup - 2.0.0-0.5 -- Add missing debug info to binaries (patch from Jan Kratochvil) - resolves: #1184257 - -* Fri Jan 30 2015 jchaloup - 2.0.0-0.4 -- Update to etcd-2.0.0 -- use gopath as the last directory to search for source code - related: #1176138 - -* Mon Jan 26 2015 jchaloup - 2.0.0-0.3.rc1 -- default to /var/lib/etcd/default.etcd as 2.0 uses that default (f21 commit byt eparis) - related: #1176138 - fix /etc/etcd/etcd.conf path - -* Tue Jan 20 2015 jchaloup - 2.0.0-0.2.rc1 -- Update of BuildRequires/Requires, Provides and test - Add BuildRequire on jonboulle/clockwork - related: #1176138 - -* Tue Dec 23 2014 Lokesh Mandvekar - 2.0.0-0.1.rc1 -- Resolves: rhbz#1176138 - update to v2.0.0-rc1 -- do not redefine gopath -- use jonboulle/clockwork from within Godeps - -* Fri Oct 17 2014 jchaloup - 0.4.6-7 -- Add ExclusiveArch for go_arches - -* Mon Oct 06 2014 jchaloup - 0.4.6-6 -- related: #1047194 - Remove dependency on go.net - -* Mon Oct 06 2014 jchaloup - 0.4.6-5 -- Fix the .service file so it can launch! - related: #1047194 - -* Mon Sep 22 2014 jchaloup - 0.4.6-4 -- resolves: #1047194 - Update to 0.4.6 from https://github.com/projectatomic/etcd-package - -* Tue Aug 19 2014 Adam Miller - 0.4.6-3 -- Add devel sub-package - -* Wed Aug 13 2014 Eric Paris - 0.4.6-2 -- Bump to 0.4.6 -- run as etcd, not root - -* Sat Jun 07 2014 Fedora Release Engineering - 0.1.2-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Sun Oct 20 2013 Peter Lemenkov - 0.1.2-5 -- goprotobuf library unbundled (see rhbz #1018477) -- go-log library unbundled (see rhbz #1018478) -- go-raft library unbundled (see rhbz #1018479) -- go-systemd library unbundled (see rhbz #1018480) -- kardianos library unbundled (see rhbz #1018481) - -* Sun Oct 13 2013 Peter Lemenkov - 0.1.2-4 -- go.net library unbundled (see rhbz #1018476) - -* Sat Oct 12 2013 Peter Lemenkov - 0.1.2-3 -- Prepare for packages unbundling -- Verbose build - -* Sat Oct 12 2013 Peter Lemenkov - 0.1.2-2 -- Fix typo in the etc.service file - -* Sat Oct 12 2013 Peter Lemenkov - 0.1.2-1 -- Ver. 0.1.2 -- Integrate with systemd - -* Mon Aug 26 2013 Luke Cypret - 0.1.1-1 -- Initial creation +%autochangelog From 4ef4ff6a93d907acbb67d4ca2d44e45b034fa22a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Mon, 9 Aug 2021 17:47:03 +0200 Subject: [PATCH 23/52] Update to 3.5.0 Close: rhbz#1932657 --- .gitignore | 1 + ...ert-int-to-string-using-strconv.Itoa.patch | 61 --- 0001-hack-etcdmain-to-generate-etcd.1.patch | 265 ----------- 0001-hack-to-generate-man-pages.patch | 120 ----- 0001-remove-unknown-field-Etcd.Debug.patch | 37 -- 0001-update-grpc-go-version-to-v1.32.0.patch | 412 ------------------ etcd.spec | 124 +++--- etcdctl.1 | 25 -- genmanpages.sh | 35 -- sources | 3 +- 10 files changed, 55 insertions(+), 1028 deletions(-) delete mode 100644 0001-Convert-int-to-string-using-strconv.Itoa.patch delete mode 100644 0001-hack-etcdmain-to-generate-etcd.1.patch delete mode 100644 0001-hack-to-generate-man-pages.patch delete mode 100644 0001-remove-unknown-field-Etcd.Debug.patch delete mode 100644 0001-update-grpc-go-version-to-v1.32.0.patch delete mode 100644 etcdctl.1 delete mode 100755 genmanpages.sh diff --git a/.gitignore b/.gitignore index 241634c..2bb6f06 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /man-3.4.13.tar.gz /etcd-3.4.14.tar.gz /man-3.4.14.tar.gz +/etcd-3.5.0.tar.gz diff --git a/0001-Convert-int-to-string-using-strconv.Itoa.patch b/0001-Convert-int-to-string-using-strconv.Itoa.patch deleted file mode 100644 index a2178d7..0000000 --- a/0001-Convert-int-to-string-using-strconv.Itoa.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 80c8dfe084f44eb660aa1af5b5d49e27e1dfd11e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= -Date: Mon, 10 Aug 2020 15:09:08 +0200 -Subject: [PATCH] Convert int to string using strconv.Itoa -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -See https://github.com/golang/go/issues/32479 - -Signed-off-by: Robert-André Mauchin ---- - etcdserver/api/v2store/store_test.go | 3 ++- - wal/wal_test.go | 3 ++- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/etcdserver/api/v2store/store_test.go b/etcdserver/api/v2store/store_test.go -index 76ec02d4e..0b1e9dad1 100644 ---- a/etcdserver/api/v2store/store_test.go -+++ b/etcdserver/api/v2store/store_test.go -@@ -15,6 +15,7 @@ - package v2store_test - - import ( -+ "strconv" - "testing" - "time" - -@@ -844,7 +845,7 @@ func TestStoreWatchSlowConsumer(t *testing.T) { - s.Watch("/foo", true, true, 0) // stream must be true - // Fill watch channel with 100 events - for i := 1; i <= 100; i++ { -- s.Set("/foo", false, string(i), v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok -+ s.Set("/foo", false, strconv.Itoa(i), v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok - } - // testutil.AssertEqual(t, s.WatcherHub.count, int64(1)) - s.Set("/foo", false, "101", v2store.TTLOptionSet{ExpireTime: v2store.Permanent}) // ok -diff --git a/wal/wal_test.go b/wal/wal_test.go -index f457dbf3c..8e8a252a0 100644 ---- a/wal/wal_test.go -+++ b/wal/wal_test.go -@@ -25,6 +25,7 @@ import ( - "path/filepath" - "reflect" - "regexp" -+ "strconv" - "testing" - - "go.etcd.io/etcd/pkg/fileutil" -@@ -239,7 +240,7 @@ func TestVerify(t *testing.T) { - - // make 5 separate files - for i := 0; i < 5; i++ { -- es := []raftpb.Entry{{Index: uint64(i), Data: []byte("waldata" + string(i+1))}} -+ es := []raftpb.Entry{{Index: uint64(i), Data: []byte("waldata" + strconv.Itoa(i+1))}} - if err = w.Save(raftpb.HardState{}, es); err != nil { - t.Fatal(err) - } --- -2.26.2 - diff --git a/0001-hack-etcdmain-to-generate-etcd.1.patch b/0001-hack-etcdmain-to-generate-etcd.1.patch deleted file mode 100644 index 6c715d7..0000000 --- a/0001-hack-etcdmain-to-generate-etcd.1.patch +++ /dev/null @@ -1,265 +0,0 @@ -diff -up etcd-3.4.13/etcdmain/config.go.orig etcd-3.4.13/etcdmain/config.go ---- etcd-3.4.13/etcdmain/config.go.orig 2020-08-24 21:11:28.000000000 +0200 -+++ etcd-3.4.13/etcdmain/config.go 2020-09-04 00:12:28.424764763 +0200 -@@ -123,14 +123,15 @@ func newConfig() *config { - ), - } - -- fs := cfg.cf.flagSet -- fs.Usage = func() { -+ fs := InitFlagSet(cfg.cf.flagSet) -+ cfg.cf.flagSet.Usage = func() { - fmt.Fprintln(os.Stderr, usageline) - } - - fs.StringVar(&cfg.configFile, "config-file", "", "Path to the server configuration file. Note that if a configuration file is provided, other command line flags and environment variables will be ignored.") - - // member -+ fs.AddGroup("member") - fs.StringVar(&cfg.ec.Dir, "data-dir", cfg.ec.Dir, "Path to the data directory.") - fs.StringVar(&cfg.ec.WalDir, "wal-dir", cfg.ec.WalDir, "Path to the dedicated wal directory.") - fs.Var( -@@ -163,7 +164,7 @@ func newConfig() *config { - fs.DurationVar(&cfg.ec.GRPCKeepAliveInterval, "grpc-keepalive-interval", cfg.ec.GRPCKeepAliveInterval, "Frequency duration of server-to-client ping to check if a connection is alive (0 to disable).") - fs.DurationVar(&cfg.ec.GRPCKeepAliveTimeout, "grpc-keepalive-timeout", cfg.ec.GRPCKeepAliveTimeout, "Additional duration of wait before closing a non-responsive connection (0 to disable).") - -- // clustering -+ fs.AddGroup("clustering") - fs.Var( - flags.NewUniqueURLsWithExceptions(embed.DefaultInitialAdvertisePeerURLs, ""), - "initial-advertise-peer-urls", -@@ -188,7 +189,7 @@ func newConfig() *config { - fs.BoolVar(&cfg.ec.EnableV2, "enable-v2", cfg.ec.EnableV2, "Accept etcd V2 client requests.") - fs.BoolVar(&cfg.ec.PreVote, "pre-vote", cfg.ec.PreVote, "Enable to run an additional Raft election phase.") - -- // proxy -+ fs.AddGroup("proxy") - fs.Var(cfg.cf.proxy, "proxy", fmt.Sprintf("Valid values include %q", cfg.cf.proxy.Valids())) - fs.UintVar(&cfg.cp.ProxyFailureWaitMs, "proxy-failure-wait", cfg.cp.ProxyFailureWaitMs, "Time (in milliseconds) an endpoint will be held in a failed state.") - fs.UintVar(&cfg.cp.ProxyRefreshIntervalMs, "proxy-refresh-interval", cfg.cp.ProxyRefreshIntervalMs, "Time (in milliseconds) of the endpoints refresh interval.") -@@ -196,7 +197,7 @@ func newConfig() *config { - fs.UintVar(&cfg.cp.ProxyWriteTimeoutMs, "proxy-write-timeout", cfg.cp.ProxyWriteTimeoutMs, "Time (in milliseconds) for a write to timeout.") - fs.UintVar(&cfg.cp.ProxyReadTimeoutMs, "proxy-read-timeout", cfg.cp.ProxyReadTimeoutMs, "Time (in milliseconds) for a read to timeout.") - -- // security -+ fs.AddGroup("security") - fs.StringVar(&cfg.ec.ClientTLSInfo.CertFile, "cert-file", "", "Path to the client server TLS cert file.") - fs.StringVar(&cfg.ec.ClientTLSInfo.KeyFile, "key-file", "", "Path to the client server TLS key file.") - fs.BoolVar(&cfg.ec.ClientTLSInfo.ClientCertAuth, "client-cert-auth", false, "Enable client cert authentication.") -@@ -222,7 +223,7 @@ func newConfig() *config { - ) - fs.Var(flags.NewUniqueStringsValue("*"), "host-whitelist", "Comma-separated acceptable hostnames from HTTP client requests, if server is not secure (empty means allow all).") - -- // logging -+ fs.AddGroup("logging") - fs.StringVar(&cfg.ec.Logger, "logger", "capnslog", "Specify 'zap' for structured logging or 'capnslog'. WARN: 'capnslog' is being deprecated in v3.5.") - fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-output", "[TO BE DEPRECATED IN v3.5] use '--log-outputs'.") - fs.Var(flags.NewUniqueStringsValue(embed.DefaultLogOutput), "log-outputs", "Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd, or list of comma separated output targets.") -@@ -230,27 +231,27 @@ func newConfig() *config { - fs.StringVar(&cfg.ec.LogLevel, "log-level", logutil.DefaultLogLevel, "Configures log level. Only supports debug, info, warn, error, panic, or fatal. Default 'info'.") - fs.StringVar(&cfg.ec.LogPkgLevels, "log-package-levels", "", "[TO BE DEPRECATED IN v3.5] Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG').") - -- // version -+ fs.AddGroup("version") - fs.BoolVar(&cfg.printVersion, "version", false, "Print the version and exit.") - - fs.StringVar(&cfg.ec.AutoCompactionRetention, "auto-compaction-retention", "0", "Auto compaction retention for mvcc key value store. 0 means disable auto compaction.") - fs.StringVar(&cfg.ec.AutoCompactionMode, "auto-compaction-mode", "periodic", "interpret 'auto-compaction-retention' one of: periodic|revision. 'periodic' for duration based retention, defaulting to hours if no time unit is provided (e.g. '5m'). 'revision' for revision number based retention.") - -- // pprof profiler via HTTP -+ fs.AddGroup("profiling") - fs.BoolVar(&cfg.ec.EnablePprof, "enable-pprof", false, "Enable runtime profiling data via HTTP server. Address is at client URL + \"/debug/pprof/\"") - - // additional metrics - fs.StringVar(&cfg.ec.Metrics, "metrics", cfg.ec.Metrics, "Set level of detail for exported metrics, specify 'extensive' to include histogram metrics") - -- // auth -+ fs.AddGroup("auth") - fs.StringVar(&cfg.ec.AuthToken, "auth-token", cfg.ec.AuthToken, "Specify auth token specific options.") - fs.UintVar(&cfg.ec.BcryptCost, "bcrypt-cost", cfg.ec.BcryptCost, "Specify bcrypt algorithm cost factor for auth password hashing.") - fs.UintVar(&cfg.ec.AuthTokenTTL, "auth-token-ttl", cfg.ec.AuthTokenTTL, "The lifetime in seconds of the auth token.") - -- // gateway -+ fs.AddGroup("gateway") - fs.BoolVar(&cfg.ec.EnableGRPCGateway, "enable-grpc-gateway", true, "Enable GRPC gateway.") - -- // experimental -+ fs.AddGroup("experimental") - fs.BoolVar(&cfg.ec.ExperimentalInitialCorruptCheck, "experimental-initial-corrupt-check", cfg.ec.ExperimentalInitialCorruptCheck, "Enable to check data corruption before serving any client/peer traffic.") - fs.DurationVar(&cfg.ec.ExperimentalCorruptCheckTime, "experimental-corrupt-check-time", cfg.ec.ExperimentalCorruptCheckTime, "Duration of time between cluster corruption check passes.") - fs.StringVar(&cfg.ec.ExperimentalEnableV2V3, "experimental-enable-v2v3", cfg.ec.ExperimentalEnableV2V3, "v3 prefix for serving emulated v2 state.") -@@ -259,9 +260,12 @@ func newConfig() *config { - fs.IntVar(&cfg.ec.ExperimentalCompactionBatchLimit, "experimental-compaction-batch-limit", cfg.ec.ExperimentalCompactionBatchLimit, "Sets the maximum revisions deleted in each compaction batch.") - fs.DurationVar(&cfg.ec.ExperimentalWatchProgressNotifyInterval, "experimental-watch-progress-notify-interval", cfg.ec.ExperimentalWatchProgressNotifyInterval, "Duration of periodic watch progress notifications.") - -- // unsafe -+ fs.AddGroup("unsafe") - fs.BoolVar(&cfg.ec.UnsafeNoFsync, "unsafe-no-fsync", false, "Disables fsync, unsafe, will cause data loss.") - fs.BoolVar(&cfg.ec.ForceNewCluster, "force-new-cluster", false, "Force to create a new one member cluster.") -+ -+ fs.GenMan() -+ os.Exit(0) - - // ignored - for _, f := range cfg.ignored { -diff -up etcd-3.4.13/etcdmain/fake_flagset.go.orig etcd-3.4.13/etcdmain/fake_flagset.go ---- etcd-3.4.13/etcdmain/fake_flagset.go.orig 2020-09-04 00:10:11.223684457 +0200 -+++ etcd-3.4.13/etcdmain/fake_flagset.go 2020-09-04 00:10:11.223684457 +0200 -@@ -0,0 +1,157 @@ -+package etcdmain -+ -+import ( -+ "flag" -+ "fmt" -+ "strconv" -+ "strings" -+ "time" -+) -+ -+type flagInfo struct { -+ value fmt.Stringer -+ name string -+ usage string -+} -+ -+type stringValue string -+ -+func (s *stringValue) String() string { return string(*s) } -+ -+type uintValue uint -+ -+func (i *uintValue) String() string { return strconv.FormatUint(uint64(*i), 10) } -+ -+type uint64Value uint64 -+ -+func (i *uint64Value) String() string { return strconv.FormatUint(uint64(*i), 10) } -+ -+type int64Value int64 -+ -+func (i *int64Value) String() string { return strconv.FormatInt(int64(*i), 10) } -+ -+type durationValue time.Duration -+ -+func (d *durationValue) String() string { return (*time.Duration)(d).String() } -+ -+type boolValue bool -+ -+func (b *boolValue) String() string { return strconv.FormatBool(bool(*b)) } -+ -+type FakeFlagSet struct { -+ fs *flag.FlagSet -+ flags map[string][]flagInfo -+ groups []string -+ lastGroup string -+} -+ -+func InitFlagSet(fs *flag.FlagSet) *FakeFlagSet { -+ return &FakeFlagSet{ -+ fs: fs, -+ flags: make(map[string][]flagInfo), -+ } -+} -+ -+func (fs *FakeFlagSet) AddGroup(name string) { -+ fs.flags[name] = nil -+ fs.groups = append(fs.groups, name) -+ fs.lastGroup = name -+} -+ -+func (fs *FakeFlagSet) Var(value flag.Value, name string, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: value, -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.Var(value, name, usage) -+} -+ -+func (fs *FakeFlagSet) StringVar(p *string, name string, value string, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*stringValue)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.StringVar(p, name, value, usage) -+} -+ -+// -- int Value -+type intValue int -+ -+func (i *intValue) String() string { return strconv.Itoa(int(*i)) } -+ -+func (fs *FakeFlagSet) UintVar(p *uint, name string, value uint, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*uintValue)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.UintVar(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*uint64Value)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.Uint64Var(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) IntVar(p *int, name string, value int, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*intValue)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.IntVar(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) Int64Var(p *int64, name string, value int64, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*int64Value)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.Int64Var(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*durationValue)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.DurationVar(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) BoolVar(p *bool, name string, value bool, usage string) { -+ fs.flags[fs.lastGroup] = append(fs.flags[fs.lastGroup], flagInfo{ -+ value: (*boolValue)(&value), -+ name: name, -+ usage: usage, -+ }) -+ fs.fs.BoolVar(p, name, value, usage) -+} -+ -+func (fs *FakeFlagSet) GenMan() { -+ fmt.Printf(".TH \"ETCD\" \"1\" \" etcd User Manuals\" \"Etcd contributors\" \"Nov 2017\" \"\"\n") -+ fmt.Printf(".SH NAME:\netcd - Distributed reliable key-value store for the most critical data of a distributed system\n\n") -+ fmt.Printf(".SH USAGE:\netcd [flags]\n\n") -+ fmt.Printf(".SH DESCRIPTION:\nEtcd is a distributed key-value store designed to reliably and quickly preserve and provide access to critical data. It enables reliable distributed coordination through distributed locking, leader elections, and write barriers. An etcd cluster is intended for high availability and permanent data storage and retrieval.\n\n") -+ fmt.Printf(".SH GENERAL OPTIONS\n\n") -+ for _, group := range fs.groups { -+ fmt.Printf(".I %v flags\n\n", strings.Title(group)) -+ for _, flag := range fs.flags[group] { -+ var flagstr string -+ if len(flag.name) == 1 { -+ flagstr = "-" + flag.name -+ } else { -+ flagstr = "--" + flag.name -+ } -+ fmt.Printf(".RS\n\\fB%v %v\\fP\n %v\n\n.RE\n", flagstr, flag.value.String(), flag.usage) -+ } -+ } -+ fmt.Printf(".SH SEE ALSO:\n\\fBetcdctl(1)\\fP, \\fBetcdctl2(1)\\fP, \\fBetcdctl3(1)\\fP\n\n") -+} diff --git a/0001-hack-to-generate-man-pages.patch b/0001-hack-to-generate-man-pages.patch deleted file mode 100644 index 37ea9cf..0000000 --- a/0001-hack-to-generate-man-pages.patch +++ /dev/null @@ -1,120 +0,0 @@ -diff -up etcd-3.4.13/etcdctl/ctlv2/ctl.go.orig2 etcd-3.4.13/etcdctl/ctlv2/ctl.go ---- etcd-3.4.13/etcdctl/ctlv2/ctl.go.orig2 2020-08-24 21:11:28.000000000 +0200 -+++ etcd-3.4.13/etcdctl/ctlv2/ctl.go 2020-09-04 00:13:47.552811076 +0200 -@@ -36,6 +36,68 @@ func Start() { - } - app.Usage = "A simple command line client for etcd." - -+ cli.AppHelpTemplate = `.TH "ETCD" "1" " etcd User Manuals" "Etcd contributors" "Nov 2017" "" -+.SH NAME: -+{{.Name}} - {{.Usage}} -+ -+{{if .Version}} -+.SH VERSION: -+ {{.Version}} -+{{end}} -+ -+.SH USAGE: -+ {{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}} -+ {{if .Commands}} -+ -+.SH COMMANDS: -+{{range .Commands}}{{if not .HideHelp}}\fB{{ .Name }}\fP{{ "\n\t\t\t" }}{{.Usage}}{{ "\n" }} -+ -+{{end}}{{end}}{{end}}{{if .VisibleFlags}} -+ -+.SH GLOBAL OPTIONS: -+{{range .VisibleFlags}}{{ . }} -+ -+{{end}}{{end}} -+ -+.SH SEE ALSO -+{{range .Commands}}{{if not .HideHelp}}{{if ne .Name "help" }}\fBetcdctl-{{ .Name }}(1)\fP, -+{{end}}{{end}}{{end}} -+` -+ -+ cli.CommandHelpTemplate = `.TH "ETCD" "1" " etcd User Manuals" "Etcd contributors" "Nov 2017" "" -+.SH NAME: -+ {{.HelpName}} - {{.Usage}} -+ -+.SH USAGE: -+ {{.HelpName}}{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}} -+ -+{{if .VisibleFlags}} -+.SH OPTIONS: -+ {{range .VisibleFlags}}{{.}} -+ {{end}}{{end}} -+` -+ -+ -+ cli.SubcommandHelpTemplate = `.TH "ETCD" "1" " etcd User Manuals" "Etcd contributors" "Nov 2017" "" -+.SH NAME: -+ {{.HelpName}} - {{.Usage}} -+ -+.SH USAGE: -+ {{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}} -+ -+.SH COMMANDS: -+{{range .VisibleCategories}}{{if .Name}} -+{{.Name}}:{{end}}{{range .VisibleCommands}} -+\fB{{ .Name }}\fP{{"\n\t\t\t"}}{{.Usage}}{{ "\n" }}{{end}} -+{{end}} -+ -+{{if .VisibleFlags}} -+.SH OPTIONS: -+{{range .VisibleFlags}}{{.}} -+{{end}}{{end}} -+` -+ -+ - app.Flags = []cli.Flag{ - cli.BoolFlag{Name: "debug", Usage: "output cURL commands which can be used to reproduce the request"}, - cli.BoolFlag{Name: "no-sync", Usage: "don't synchronize cluster information before sending request"}, -diff -up etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go.orig2 etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go ---- etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go.orig2 2020-08-24 21:11:28.000000000 +0200 -+++ etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go 2020-09-04 00:13:47.553811076 +0200 -@@ -16,13 +16,20 @@ - - package ctlv3 - --import "go.etcd.io/etcd/etcdctl/ctlv3/command" -+//import "github.com/coreos/etcd/etcdctl/ctlv3/command" -+import cobra "github.com/spf13/cobra/doc" - - func Start() { - rootCmd.SetUsageFunc(usageFunc) - // Make help just show the usage - rootCmd.SetHelpTemplate(`{{.UsageString}}`) -- if err := rootCmd.Execute(); err != nil { -- command.ExitWithError(command.ExitError, err) -+ //if err := rootCmd.Execute(); err != nil { -+ // command.ExitWithError(command.ExitError, err) -+ //} -+ header := &cobra.GenManHeader{ -+ Title: "etcdctl3", -+ Section: "1", - } -+ -+ cobra.GenManTree(rootCmd, header, "") - } -diff -up etcd-3.4.13/vendor/github.com/urfave/cli/flag.go.orig2 etcd-3.4.13/vendor/github.com/urfave/cli/flag.go ---- etcd-3.4.13/vendor/github.com/urfave/cli/flag.go.orig2 2020-08-24 21:11:28.000000000 +0200 -+++ etcd-3.4.13/vendor/github.com/urfave/cli/flag.go 2020-09-04 00:13:47.555811078 +0200 -@@ -670,7 +670,7 @@ func prefixedNames(fullName, placeholder - parts := strings.Split(fullName, ",") - for i, name := range parts { - name = strings.Trim(name, " ") -- prefixed += prefixFor(name) + name -+ prefixed += "\\fB" + prefixFor(name) + name + "\\fP" - if placeholder != "" { - prefixed += " " + placeholder - } -@@ -745,7 +745,7 @@ func stringifyFlag(f Flag) string { - usageWithDefault := strings.TrimSpace(fmt.Sprintf("%s%s", usage, defaultValueString)) - - return withEnvHint(fv.FieldByName("EnvVar").String(), -- fmt.Sprintf("%s\t%s", prefixedNames(fv.FieldByName("Name").String(), placeholder), usageWithDefault)) -+ fmt.Sprintf("%s\n\t\t\t%s", prefixedNames(fv.FieldByName("Name").String(), placeholder), usageWithDefault)) - } - - func stringifyIntSliceFlag(f IntSliceFlag) string { diff --git a/0001-remove-unknown-field-Etcd.Debug.patch b/0001-remove-unknown-field-Etcd.Debug.patch deleted file mode 100644 index 76ec821..0000000 --- a/0001-remove-unknown-field-Etcd.Debug.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 2c95b49b63651ae3e0a3f63c45c05295d1af2c42 Mon Sep 17 00:00:00 2001 -From: lsytj0413 <511121939@qq.com> -Date: Thu, 19 Sep 2019 09:51:51 +0800 -Subject: [PATCH] test(functional): remove unknown field Etcd.Debug - ---- - functional/tester/cluster_test.go | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/functional/tester/cluster_test.go b/functional/tester/cluster_test.go -index 7c7b25f2ad..2948c00e7f 100644 ---- a/functional/tester/cluster_test.go -+++ b/functional/tester/cluster_test.go -@@ -64,7 +64,6 @@ func Test_read(t *testing.T) { - InitialCorruptCheck: true, - Logger: "zap", - LogOutputs: []string{"/tmp/etcd-functional-1/etcd.log"}, -- Debug: true, - }, - ClientCertData: "", - ClientCertPath: "", -@@ -117,7 +116,6 @@ func Test_read(t *testing.T) { - InitialCorruptCheck: true, - Logger: "zap", - LogOutputs: []string{"/tmp/etcd-functional-2/etcd.log"}, -- Debug: true, - }, - ClientCertData: "", - ClientCertPath: "", -@@ -170,7 +168,6 @@ func Test_read(t *testing.T) { - InitialCorruptCheck: true, - Logger: "zap", - LogOutputs: []string{"/tmp/etcd-functional-3/etcd.log"}, -- Debug: true, - }, - ClientCertData: "", - ClientCertPath: "", diff --git a/0001-update-grpc-go-version-to-v1.32.0.patch b/0001-update-grpc-go-version-to-v1.32.0.patch deleted file mode 100644 index 4c40ac0..0000000 --- a/0001-update-grpc-go-version-to-v1.32.0.patch +++ /dev/null @@ -1,412 +0,0 @@ -From 2859e9f94608b44c9c351c7ccfcff21665573627 Mon Sep 17 00:00:00 2001 -From: Sky Ao -Date: Thu, 15 Oct 2020 15:34:16 +0800 -Subject: [PATCH 1/4] update grpc-go version to v1.32.0 which has some breaking - api changes in naming and loadbalancer package - ---- - clientv3/balancer/balancer.go | 39 ++- - clientv3/balancer/picker/err.go | 6 +- - .../balancer/picker/roundrobin_balanced.go | 7 +- - clientv3/naming/grpc.go | 27 +- - clientv3/naming/grpcnaming/naming.go | 73 +++++ - proxy/grpcproxy/cluster.go | 2 +- - proxy/grpcproxy/register.go | 2 +- - 7 files changed, 424 insertions(+), 46 deletions(-) - create mode 100644 clientv3/naming/grpcnaming/naming.go - -diff --git a/clientv3/balancer/balancer.go b/clientv3/balancer/balancer.go -index 3eecb9d1d2..d3e672c632 100644 ---- a/clientv3/balancer/balancer.go -+++ b/clientv3/balancer/balancer.go -@@ -136,15 +136,34 @@ type baseBalancer struct { - connectivityRecorder connectivity.Recorder - - picker picker.Picker -+ -+ resolverErr error // the last error reported by the resolver; cleared on successful resolution - } - --// HandleResolvedAddrs implements "grpc/balancer.Balancer" interface. --// gRPC sends initial or updated resolved addresses from "Build". --func (bb *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) { -- if err != nil { -- bb.lg.Warn("HandleResolvedAddrs called with error", zap.String("balancer-id", bb.id), zap.Error(err)) -+func (bb *baseBalancer) ResolverError(err error) { -+ bb.resolverErr = err -+ if len(bb.addrToSc) == 0 { -+ bb.connectivityRecorder.RecordTransition(bb.connectivityRecorder.GetCurrentState(), grpcconnectivity.TransientFailure) -+ } -+ -+ if bb.connectivityRecorder.GetCurrentState() != grpcconnectivity.TransientFailure { -+ // The picker will not change since the balancer does not currently -+ // report an error. - return - } -+ bb.updatePicker() -+ bb.currentConn.UpdateState(balancer.State{ -+ ConnectivityState: bb.connectivityRecorder.GetCurrentState(), -+ Picker: bb.picker, -+ }) -+} -+ -+// UpdateClientConnState implements "grpc/balancer.Balancer" interface. -+func (bb *baseBalancer) UpdateClientConnState(state balancer.ClientConnState) error { -+ addrs := state.ResolverState.Addresses -+ // Successful resolution; clear resolver error and ensure we return nil. -+ bb.resolverErr = nil -+ - bb.lg.Info("resolved", - zap.String("picker", bb.picker.String()), - zap.String("balancer-id", bb.id), -@@ -191,10 +210,14 @@ func (bb *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) - // (DO NOT) delete(bb.scToSt, sc) - } - } -+ -+ return nil - } - --// HandleSubConnStateChange implements "grpc/balancer.Balancer" interface. --func (bb *baseBalancer) HandleSubConnStateChange(sc balancer.SubConn, s grpcconnectivity.State) { -+// UpdateSubConnState implements "grpc/balancer.Balancer" interface. -+func (bb *baseBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { -+ s := state.ConnectivityState -+ - bb.mu.Lock() - defer bb.mu.Unlock() - -@@ -247,7 +270,7 @@ func (bb *baseBalancer) HandleSubConnStateChange(sc balancer.SubConn, s grpcconn - bb.updatePicker() - } - -- bb.currentConn.UpdateBalancerState(bb.connectivityRecorder.GetCurrentState(), bb.picker) -+ bb.currentConn.UpdateState(balancer.State{ConnectivityState: bb.connectivityRecorder.GetCurrentState(), Picker: bb.picker}) - } - - func (bb *baseBalancer) updatePicker() { -diff --git a/clientv3/balancer/picker/err.go b/clientv3/balancer/picker/err.go -index f4b941d652..a37baa7bd2 100644 ---- a/clientv3/balancer/picker/err.go -+++ b/clientv3/balancer/picker/err.go -@@ -15,8 +15,6 @@ - package picker - - import ( -- "context" -- - "google.golang.org/grpc/balancer" - ) - -@@ -34,6 +32,6 @@ func (ep *errPicker) String() string { - return ep.p.String() - } - --func (ep *errPicker) Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) { -- return nil, nil, ep.err -+func (ep *errPicker) Pick(balancer.PickInfo) (balancer.PickResult, error) { -+ return balancer.PickResult{}, ep.err - } -diff --git a/clientv3/balancer/picker/roundrobin_balanced.go b/clientv3/balancer/picker/roundrobin_balanced.go -index e3971ecc42..993c05ec13 100644 ---- a/clientv3/balancer/picker/roundrobin_balanced.go -+++ b/clientv3/balancer/picker/roundrobin_balanced.go -@@ -15,7 +15,6 @@ - package picker - - import ( -- "context" - "sync" - - "go.uber.org/zap" -@@ -52,12 +51,12 @@ type rrBalanced struct { - func (rb *rrBalanced) String() string { return rb.p.String() } - - // Pick is called for every client request. --func (rb *rrBalanced) Pick(ctx context.Context, opts balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) { -+func (rb *rrBalanced) Pick(opts balancer.PickInfo) (balancer.PickResult, error) { - rb.mu.RLock() - n := len(rb.scs) - rb.mu.RUnlock() - if n == 0 { -- return nil, nil, balancer.ErrNoSubConnAvailable -+ return balancer.PickResult{}, balancer.ErrNoSubConnAvailable - } - - rb.mu.Lock() -@@ -91,5 +90,5 @@ func (rb *rrBalanced) Pick(ctx context.Context, opts balancer.PickInfo) (balance - rb.lg.Warn("balancer failed", fss...) - } - } -- return sc, doneFunc, nil -+ return balancer.PickResult{SubConn: sc, Done: doneFunc}, nil - } -diff --git a/clientv3/naming/grpc.go b/clientv3/naming/grpc.go -index b680274bb3..f7cd2bd8a6 100644 ---- a/clientv3/naming/grpc.go -+++ b/clientv3/naming/grpc.go -@@ -20,9 +20,9 @@ import ( - "fmt" - - etcd "go.etcd.io/etcd/clientv3" -+ gnaming "go.etcd.io/etcd/clientv3/naming/grpcnaming" - - "google.golang.org/grpc/codes" -- "google.golang.org/grpc/naming" - "google.golang.org/grpc/status" - ) - -@@ -34,15 +33,15 @@ type GRPCResolver struct { - Client *etcd.Client - } - --func (gr *GRPCResolver) Update(ctx context.Context, target string, nm naming.Update, opts ...etcd.OpOption) (err error) { -+func (gr *GRPCResolver) Update(ctx context.Context, target string, nm gnaming.Update, opts ...etcd.OpOption) (err error) { - switch nm.Op { -- case naming.Add: -+ case gnaming.Add: - var v []byte - if v, err = json.Marshal(nm); err != nil { - return status.Error(codes.InvalidArgument, err.Error()) - } - _, err = gr.Client.KV.Put(ctx, target+"/"+nm.Addr, string(v), opts...) -- case naming.Delete: -+ case gnaming.Delete: - _, err = gr.Client.Delete(ctx, target+"/"+nm.Addr, opts...) - default: - return status.Error(codes.InvalidArgument, "naming: bad naming op") -@@ -50,7 +49,7 @@ func (gr *GRPCResolver) Update(ctx context.Context, target string, nm naming.Upd - return err - } - --func (gr *GRPCResolver) Resolve(target string) (naming.Watcher, error) { -+func (gr *GRPCResolver) Resolve(target string) (gnaming.Watcher, error) { - ctx, cancel := context.WithCancel(context.Background()) - w := &gRPCWatcher{c: gr.Client, target: target + "/", ctx: ctx, cancel: cancel} - return w, nil -@@ -68,7 +67,7 @@ type gRPCWatcher struct { - // Next gets the next set of updates from the etcd resolver. - // Calls to Next should be serialized; concurrent calls are not safe since - // there is no way to reconcile the update ordering. --func (gw *gRPCWatcher) Next() ([]*naming.Update, error) { -+func (gw *gRPCWatcher) Next() ([]*gnaming.Update, error) { - if gw.wch == nil { - // first Next() returns all addresses - return gw.firstNext() -@@ -87,17 +86,17 @@ func (gw *gRPCWatcher) Next() ([]*naming.Update, error) { - return nil, gw.err - } - -- updates := make([]*naming.Update, 0, len(wr.Events)) -+ updates := make([]*gnaming.Update, 0, len(wr.Events)) - for _, e := range wr.Events { -- var jupdate naming.Update -+ var jupdate gnaming.Update - var err error - switch e.Type { - case etcd.EventTypePut: - err = json.Unmarshal(e.Kv.Value, &jupdate) -- jupdate.Op = naming.Add -+ jupdate.Op = gnaming.Add - case etcd.EventTypeDelete: - err = json.Unmarshal(e.PrevKv.Value, &jupdate) -- jupdate.Op = naming.Delete -+ jupdate.Op = gnaming.Delete - default: - continue - } -@@ -108,7 +107,7 @@ func (gw *gRPCWatcher) Next() ([]*naming.Update, error) { - return updates, nil - } - --func (gw *gRPCWatcher) firstNext() ([]*naming.Update, error) { -+func (gw *gRPCWatcher) firstNext() ([]*gnaming.Update, error) { - // Use serialized request so resolution still works if the target etcd - // server is partitioned away from the quorum. - resp, err := gw.c.Get(gw.ctx, gw.target, etcd.WithPrefix(), etcd.WithSerializable()) -@@ -116,9 +115,9 @@ func (gw *gRPCWatcher) firstNext() ([]*naming.Update, error) { - return nil, err - } - -- updates := make([]*naming.Update, 0, len(resp.Kvs)) -+ updates := make([]*gnaming.Update, 0, len(resp.Kvs)) - for _, kv := range resp.Kvs { -- var jupdate naming.Update -+ var jupdate gnaming.Update - if err := json.Unmarshal(kv.Value, &jupdate); err != nil { - continue - } -diff --git a/clientv3/naming/grpcnaming/naming.go b/clientv3/naming/grpcnaming/naming.go -new file mode 100644 -index 0000000000..9b1f20cc61 ---- /dev/null -+++ b/clientv3/naming/grpcnaming/naming.go -@@ -0,0 +1,73 @@ -+/* -+ * -+ * Copyright 2014 gRPC authors. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ * -+ */ -+ -+// Package naming defines the naming API and related data structures for gRPC. -+// -+// This package is deprecated: please use package resolver instead. -+ -+ -+// Notice: this file is a copy of naming/naming.go from grpc-go v1.29.1. -+// The package of grpc naming is removed since grpc-go v1.30.0. -+// This is a work around to make etcd work with grpc new version (>=v1.30.0) without too many code change. -+package grpcnaming -+ -+// Operation defines the corresponding operations for a name resolution change. -+// -+// Deprecated: please use package resolver. -+type Operation uint8 -+ -+const ( -+ // Add indicates a new address is added. -+ Add Operation = iota -+ // Delete indicates an existing address is deleted. -+ Delete -+) -+ -+// Update defines a name resolution update. Notice that it is not valid having both -+// empty string Addr and nil Metadata in an Update. -+// -+// Deprecated: please use package resolver. -+type Update struct { -+ // Op indicates the operation of the update. -+ Op Operation -+ // Addr is the updated address. It is empty string if there is no address update. -+ Addr string -+ // Metadata is the updated metadata. It is nil if there is no metadata update. -+ // Metadata is not required for a custom naming implementation. -+ Metadata interface{} -+} -+ -+// Resolver creates a Watcher for a target to track its resolution changes. -+// -+// Deprecated: please use package resolver. -+type Resolver interface { -+ // Resolve creates a Watcher for target. -+ Resolve(target string) (Watcher, error) -+} -+ -+// Watcher watches for the updates on the specified target. -+// -+// Deprecated: please use package resolver. -+type Watcher interface { -+ // Next blocks until an update or error happens. It may return one or more -+ // updates. The first call should get the full set of the results. It should -+ // return an error if and only if Watcher cannot recover. -+ Next() ([]*Update, error) -+ // Close closes the Watcher. -+ Close() -+} -\ No newline at end of file -diff --git a/proxy/grpcproxy/cluster.go b/proxy/grpcproxy/cluster.go -index 5f3ab76584..a786457a6a 100644 ---- a/proxy/grpcproxy/cluster.go -+++ b/proxy/grpcproxy/cluster.go -@@ -18,6 +18,7 @@ import ( - "context" - "errors" - "fmt" -+ gnaming "go.etcd.io/etcd/clientv3/naming/grpcnaming" - "os" - "sync" - -@@ -27,7 +28,6 @@ import ( - pb "go.etcd.io/etcd/etcdserver/etcdserverpb" - - "golang.org/x/time/rate" -- gnaming "google.golang.org/grpc/naming" - ) - - // allow maximum 1 retry per second -diff --git a/proxy/grpcproxy/register.go b/proxy/grpcproxy/register.go -index e74cd5ca90..912e147d77 100644 ---- a/proxy/grpcproxy/register.go -+++ b/proxy/grpcproxy/register.go -@@ -16,6 +16,7 @@ package grpcproxy - - import ( - "encoding/json" -+ gnaming "go.etcd.io/etcd/clientv3/naming/grpcnaming" - "os" - - "go.etcd.io/etcd/clientv3" -@@ -23,7 +24,6 @@ import ( - "go.etcd.io/etcd/clientv3/naming" - - "golang.org/x/time/rate" -- gnaming "google.golang.org/grpc/naming" - ) - - // allow maximum 1 retry per second -From b1d600ee05737adf6fc2ba3a5c3d92c1037bb6a6 Mon Sep 17 00:00:00 2001 -From: Sky Ao -Date: Thu, 22 Oct 2020 11:20:17 +0800 -Subject: [PATCH 3/4] add doc for method ResolveError() - ---- - clientv3/balancer/balancer.go | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/clientv3/balancer/balancer.go b/clientv3/balancer/balancer.go -index d3e672c632..1488580331 100644 ---- a/clientv3/balancer/balancer.go -+++ b/clientv3/balancer/balancer.go -@@ -140,6 +140,7 @@ type baseBalancer struct { - resolverErr error // the last error reported by the resolver; cleared on successful resolution - } - -+// ResolverError implements "grpc/balancer.Balancer" interface. - func (bb *baseBalancer) ResolverError(err error) { - bb.resolverErr = err - if len(bb.addrToSc) == 0 { - -From 5ba58f2283eda7247f51b4e9dd07c367c4d77235 Mon Sep 17 00:00:00 2001 -From: Sky Ao -Date: Thu, 22 Oct 2020 11:36:03 +0800 -Subject: [PATCH 4/4] update to pass fmt checking - ---- - clientv3/naming/grpcnaming/naming.go | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - -diff --git a/clientv3/naming/grpcnaming/naming.go b/clientv3/naming/grpcnaming/naming.go -index 9b1f20cc61..a4415a6541 100644 ---- a/clientv3/naming/grpcnaming/naming.go -+++ b/clientv3/naming/grpcnaming/naming.go -@@ -19,11 +19,6 @@ - // Package naming defines the naming API and related data structures for gRPC. - // - // This package is deprecated: please use package resolver instead. -- -- --// Notice: this file is a copy of naming/naming.go from grpc-go v1.29.1. --// The package of grpc naming is removed since grpc-go v1.30.0. --// This is a work around to make etcd work with grpc new version (>=v1.30.0) without too many code change. - package grpcnaming - - // Operation defines the corresponding operations for a name resolution change. -@@ -70,4 +65,4 @@ type Watcher interface { - Next() ([]*Update, error) - // Close closes the Watcher. - Close() --} -\ No newline at end of file -+} diff --git a/etcd.spec b/etcd.spec index 7748442..37f3603 100644 --- a/etcd.spec +++ b/etcd.spec @@ -6,20 +6,18 @@ # https://github.com/etcd-io/etcd %global goipath go.etcd.io/etcd %global forgeurl https://github.com/etcd-io/etcd -Version: 3.4.14 +Version: 3.5.0 %gometa %global goipaths0 go.etcd.io/etcd -%global goipathsex0 go.etcd.io/etcd/etcdserver/api/v3rpc/ +%global goipathsex0 go.etcd.io/etcd/server/etcdserver/api/v3rpc %if %{without bootstrap} -%global goipaths1 go.etcd.io/etcd/etcdserver/api/v3rpc/ +%global goipaths1 go.etcd.io/etcd/server/etcdserver/api/v3rpc %endif - %global goaltipaths github.com/coreos/etcd go.etcd.io/etcd/v3 -%global man_version 3.4.14 %global common_description %{expand: Distributed reliable key-value store for the most critical data of a distributed @@ -41,33 +39,25 @@ URL: %{gourl} Source0: %{gosource} Source1: %{name}.service Source2: %{name}.conf -Source3: man-%{man_version}.tar.gz -# sh genmanpages.sh path_to_built_source -Source10: genmanpages.sh -# Not patches to apply here, but used on the source to generate man pages -Source11: 0001-hack-etcdmain-to-generate-etcd.1.patch -Source12: 0001-hack-to-generate-man-pages.patch -# update grpc-go version to v1.32.0 -Patch0: 0001-update-grpc-go-version-to-v1.32.0.patch -Patch1: 0001-Convert-int-to-string-using-strconv.Itoa.patch BuildRequires: golang(github.com/bgentry/speakeasy) # BuildRequires: golang(github.com/cockroachdb/datadriven) BuildRequires: golang(github.com/coreos/go-semver/semver) -BuildRequires: golang(github.com/coreos/go-systemd/daemon) -BuildRequires: golang(github.com/coreos/go-systemd/journal) -BuildRequires: golang(github.com/coreos/pkg/capnslog) +BuildRequires: golang(github.com/coreos/go-systemd/v22/daemon) +BuildRequires: golang(github.com/coreos/go-systemd/v22/journal) BuildRequires: golang(github.com/creack/pty) -BuildRequires: golang(github.com/dgrijalva/jwt-go) BuildRequires: golang(github.com/dustin/go-humanize) +BuildRequires: golang(github.com/etcd-io/gofail/runtime) +BuildRequires: golang(github.com/form3tech-oss/jwt-go) BuildRequires: golang(github.com/gogo/protobuf/gogoproto) BuildRequires: golang(github.com/gogo/protobuf/proto) BuildRequires: golang(github.com/golang/groupcache/lru) +BuildRequires: golang(github.com/golang/protobuf/descriptor) BuildRequires: golang(github.com/golang/protobuf/proto) BuildRequires: golang(github.com/google/btree) -BuildRequires: golang(github.com/google/uuid) %if %{without bootstrap} BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-middleware) +BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-middleware/logging/settable) %endif BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-prometheus) BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/runtime) @@ -81,73 +71,82 @@ BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promhttp) BuildRequires: golang(github.com/soheilhy/cmux) BuildRequires: golang(github.com/spf13/cobra) BuildRequires: golang(github.com/spf13/pflag) +BuildRequires: golang(github.com/stretchr/testify/assert) BuildRequires: golang(github.com/tmc/grpc-websocket-proxy/wsproxy) BuildRequires: golang(github.com/urfave/cli) BuildRequires: golang(github.com/xiang90/probing) BuildRequires: golang(go.etcd.io/bbolt) +BuildRequires: golang(go.opentelemetry.io/contrib-0.20/instrumentation/google.golang.org/grpc/otelgrpc) +BuildRequires: golang(go.opentelemetry.io/otel-0.20/exporters/otlp) +BuildRequires: golang(go.opentelemetry.io/otel-0.20/exporters/otlp/otlpgrpc) +BuildRequires: golang(go.opentelemetry.io/otel-0.20/propagation) +BuildRequires: golang(go.opentelemetry.io/otel-0.20/sdk/resource) +BuildRequires: golang(go.opentelemetry.io/otel-0.20/sdk/trace) +BuildRequires: golang(go.opentelemetry.io/otel-0.20/semconv) +BuildRequires: golang(go.uber.org/multierr) BuildRequires: golang(go.uber.org/zap) BuildRequires: golang(go.uber.org/zap/zapcore) +BuildRequires: golang(go.uber.org/zap/zapgrpc) +BuildRequires: golang(go.uber.org/zap/zaptest) BuildRequires: golang(golang.org/x/crypto/bcrypt) -BuildRequires: golang(golang.org/x/net/context) BuildRequires: golang(golang.org/x/net/http2) BuildRequires: golang(golang.org/x/net/trace) +BuildRequires: golang(golang.org/x/sys/unix) BuildRequires: golang(golang.org/x/time/rate) +BuildRequires: golang(google.golang.org/genproto/googleapis/api/annotations) BuildRequires: golang(google.golang.org/grpc) -BuildRequires: golang(google.golang.org/grpc/balancer) BuildRequires: golang(google.golang.org/grpc/codes) -BuildRequires: golang(google.golang.org/grpc/connectivity) BuildRequires: golang(google.golang.org/grpc/credentials) BuildRequires: golang(google.golang.org/grpc/grpclog) BuildRequires: golang(google.golang.org/grpc/health) BuildRequires: golang(google.golang.org/grpc/health/grpc_health_v1) BuildRequires: golang(google.golang.org/grpc/keepalive) BuildRequires: golang(google.golang.org/grpc/metadata) -# BuildRequires: golang(google.golang.org/grpc/naming) BuildRequires: golang(google.golang.org/grpc/peer) BuildRequires: golang(google.golang.org/grpc/resolver) -BuildRequires: golang(google.golang.org/grpc/resolver/dns) -BuildRequires: golang(google.golang.org/grpc/resolver/passthrough) +BuildRequires: golang(google.golang.org/grpc/resolver/manual) +BuildRequires: golang(google.golang.org/grpc/serviceconfig) BuildRequires: golang(google.golang.org/grpc/status) +BuildRequires: golang(google.golang.org/grpc/test/grpc_testing) BuildRequires: golang(gopkg.in/cheggaaa/pb.v1) +BuildRequires: golang(gopkg.in/natefinch/lumberjack.v2) BuildRequires: golang(gopkg.in/yaml.v2) BuildRequires: golang(sigs.k8s.io/yaml) -BuildRequires: python3-devel -# BuildRequires: %%{py3_dist sphinx sphinx-rtd-theme} -%{?systemd_requires} -BuildRequires: systemd -Requires(pre): shadow-utils - %if %{with check} # Tests +BuildRequires: golang(github.com/cockroachdb/datadriven) BuildRequires: golang(github.com/prometheus/client_model/go) +BuildRequires: golang(golang.org/x/sync/errgroup) %endif +BuildRequires: python3-devel +BuildRequires: systemd-rpm-macros +Requires(pre): shadow-utils + %description %{common_description} %gopkg %prep -%setup -q -n man-%{man_version} -T -b 3 %goprep -k -%patch0 -p1 -%patch1 -p1 +sed -i \ + -e 's|"go.opentelemetry.io/contrib|"go.opentelemetry.io/contrib-0.20|' \ + $(find . -name '*.go') +sed -i \ + -e 's|"go.opentelemetry.io/otel|"go.opentelemetry.io/otel-0.20|' \ + $(find . -name '*.go') rm -rf vendor/ rm -rf cmd/vendor rm -rf raft/rafttest -# For compatibility -cp -aR etcdserver/api/snap snap -cp -aR etcdserver/api/membership etcdserver/membership -cp -aR etcdserver/api/v2store store -for d in client clientv3 contrib etcdctl functional hack; do +for d in contrib etcdctl etcdutl pkg raft hack security; do mv $d/README.md README-$d.md done mv etcdctl/READMEv2.md READMEv2-etcdctl.md - -mkdir -p man/man1 -cp ../man-%{man_version}/*.1 man/man1/. +mv client/v2/README.md README-clientv2.md +mv client/v3/README.md README-clientv3.md %if %{without bootstrap} %build @@ -157,9 +156,6 @@ for cmd in etcdctl; do done %endif -# make -C docs help -# make -C docs html - %install %gopkginstall %if %{without bootstrap} @@ -170,10 +166,6 @@ install -Dpm 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service install -dm 0755 %{buildroot}%{_sysconfdir}/%{name} install -pm 644 -t %{buildroot}%{_sysconfdir}/%{name} %{SOURCE2} -# install manpages -install -d %{buildroot}%{_mandir}/man1 -install -pm 644 man/man1/* %{buildroot}%{_mandir}/man1 - # And create /var/lib/etcd install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} %endif @@ -181,25 +173,16 @@ install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} %if %{without bootstrap} %if %{with check} %check -%gocheck -d clientv3 \ - -d e2e \ - -d functional/rpcpb \ - -d functional/tester \ - -d tools/functional-tester/etcd-agent \ - -d integration \ - -d clientv3/integration \ - -d clientv3/balancer \ - -d clientv3/naming \ - -d clientv3/snapshot \ - -d clientv3/ordering \ - -d pkg/expect \ - -d pkg/flags \ - -d pkg/proxy \ - -d pkg/tlsutil \ - -d pkg/transport \ - -d proxy/grpcproxy \ - -t raft \ - -t tests/e2e +%gocheck -d client/v2 \ + -d client/v3 \ + -d raft \ + -d server/auth \ + -d server/wal/walpb \ + -d tests/e2ev \ + -d tests/integration \ + -d tests/e2e \ + -d tests/integration/client \ + -t tests/integration/clientv3 %endif %endif @@ -211,7 +194,7 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %post %systemd_post %{name}.service - +÷ %preun %systemd_preun %{name}.service @@ -219,14 +202,13 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %systemd_postun %{name}.service %files -%license LICENSE NOTICE +%license LICENSE %doc CONTRIBUTING.md README.md %doc Documentation README-*.md READMEv2-etcdctl.md %{_bindir}/* %config(noreplace) %{_sysconfdir}/%{name} %dir %attr(-,%{name},%{name}) %{_sharedstatedir}/%{name} %{_unitdir}/%{name}.service -%{_mandir}/man1/*.1* %endif %gopkgfiles diff --git a/etcdctl.1 b/etcdctl.1 deleted file mode 100644 index bec2361..0000000 --- a/etcdctl.1 +++ /dev/null @@ -1,25 +0,0 @@ -.TH "ETCD" "1" " etcd User Manuals" "Jan Chaloupka" "Oct 2017" "" - - -.SH NAME -.PP -etcdctl \- A simple command line client for etcd - - -.SH SYNOPSIS -.PP -\fB[ETCDCTL_API=3] etctctl\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Command line client for etcd. -Queries to v2 data model are available through \fBetcdtl\fP command (see \fBetcdctl2(1)\fP). -Queries to v3 data model are available through \fBETCDCTL=3 etcdtl\fP command (see \fBetcdctl3(1)\fP). - -.PP -Find more information at -\[la]https://github.com/coreos/etcd\[ra]. - -.SH SEE ALSO -\fBetcd(1)\fP, \fBetcdctl2(1)\fP, \fBetcdctl3(1)\fP diff --git a/genmanpages.sh b/genmanpages.sh deleted file mode 100755 index a933c40..0000000 --- a/genmanpages.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -rm -rf man -mkdir -p man/etcdctl2 man/etcdctl3 -pushd man/etcdctl3 -ETCDCTL_API=3 ../../$1/bin/etcdctl --help - -# rename to etcdctl3... -for line in $(ls *.1); do mv $line $(echo $line | sed "s/etcdctl/etcdctl3/"); done - -# rename refs -sed -i "s/\\\fBetcdctl\\\-/\\\fBetcdctl3\\\-/g" *.1 - -# stress ETCDCTL_API use -sed -i s"/^\\\fBetcdctl /\\\fBETCDCTL=3 etcdctl /" etcdctl3*.1 - -cd ../etcdctl2 -../../$1/bin/etcdctl --help > etcdctl.1 - -for cmd in $(cat etcdctl.1 | grep "\fBetcdctl\\\-" | cut -d'-' -f2-3 | cut -d'(' -f1); do ../../$1/bin/etcdctl $cmd --help > etcdctl-$cmd.1; done - -# rename to etcdctl2 -for line in $(ls *.1); do mv $line $(echo $line | sed "s/etcdctl/etcdctl2/"); done - -# rename refs -sed -i "s/\\\fBetcdctl\\\-/\\\fBetcdctl2\\\-/g" *.1 - -cd .. -mv etcdctl2/* . -mv etcdctl3/* . -rm -rf etcdctl2 etcdctl3 -cp ../etcdctl.1 . - -# Gen etcd.1 -../$1/bin/etcd --help > etcd.1 diff --git a/sources b/sources index 0653d96..2bb8355 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -SHA512 (etcd-3.4.14.tar.gz) = 61262b921104f4626131f9722a127debe7b1daac09a90fcb55fb044312b771024e913eb657ea0c59a64b493f66a07f828bcc109afadbd4cc5981034a778f3958 -SHA512 (man-3.4.14.tar.gz) = 7f1223d0891d043a8d8df2e6b5071155ffa907f7fdcde2b4ad927929917e019c1b5c8f86b240441d3eed8ac3889870d856423a699c1308bd552a579b71a5b652 +SHA512 (etcd-3.5.0.tar.gz) = ea332fe99c9bce842dc9919b7cf676db2024adf83c23c37dcd8db48bc2a2d3f98879893701644a2317dea69dc15f747f42f5473f14f4343fe7aee9a6b4ebceca From 67e4ba301915f2d2bca158e120c8f1ae859dd390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sat, 21 Aug 2021 17:54:27 +0200 Subject: [PATCH 24/52] Add symlink for alternate import paths --- etcd.spec | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/etcd.spec b/etcd.spec index 37f3603..1ee2cb9 100644 --- a/etcd.spec +++ b/etcd.spec @@ -158,6 +158,25 @@ done %install %gopkginstall +ln -s %{gopath}/src/%{goipath}/api %{buildroot}%{gopath}/src/%{goipath}/api/v3 +ln -s %{gopath}/src/%{goipath}/client/pkg %{buildroot}%{gopath}/src/%{goipath}/client/pkg/v3 +ln -s %{gopath}/src/%{goipath}/etcdctl %{buildroot}%{gopath}/src/%{goipath}/etcdctl/v3 +ln -s %{gopath}/src/%{goipath}/etcdutl %{buildroot}%{gopath}/src/%{goipath}/etcdutl/v3 +ln -s %{gopath}/src/%{goipath}/pkg %{buildroot}%{gopath}/src/%{goipath}/pkg/v3 +ln -s %{gopath}/src/%{goipath}/raft %{buildroot}%{gopath}/src/%{goipath}/raft/v3 +ln -s %{gopath}/src/%{goipath}/server %{buildroot}%{gopath}/src/%{goipath}/server/v3 +ln -s %{gopath}/src/%{goipath}/tests %{buildroot}%{gopath}/src/%{goipath}/tests/v3 +ln -s %{gopath}/src/%{goipath}/tools %{buildroot}%{gopath}/src/%{goipath}/tools/v3 +echo "%{gopath}/src/%{goipath}/api/v3" >> golang-etcd-devel.file-list +echo "%{gopath}/src/%{goipath}/client/pkg/v3" >> golang-etcd-devel.file-list +echo "%{gopath}/src/%{goipath}/etcdctl/v3" >> golang-etcd-devel.file-list +echo "%{gopath}/src/%{goipath}/etcdutl/v3" >> golang-etcd-devel.file-list +echo "%{gopath}/src/%{goipath}/pkg/v3" >> golang-etcd-devel.file-list +echo "%{gopath}/src/%{goipath}/raft/v3" >> golang-etcd-devel.file-list +echo "%{gopath}/src/%{goipath}/server/v3" >> golang-etcd-devel.file-list +echo "%{gopath}/src/%{goipath}/tests/v3" >> golang-etcd-devel.file-list +echo "%{gopath}/src/%{goipath}/tools/v3" >> golang-etcd-devel.file-list + %if %{without bootstrap} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ From 053463c20100c06eb75be2cfe790127916ff9f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Wed, 25 Aug 2021 21:23:29 +0200 Subject: [PATCH 25/52] Fix alternate import path --- etcd.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/etcd.spec b/etcd.spec index 1ee2cb9..5f1e899 100644 --- a/etcd.spec +++ b/etcd.spec @@ -176,6 +176,7 @@ echo "%{gopath}/src/%{goipath}/raft/v3" >> golang-etcd-devel.file-list echo "%{gopath}/src/%{goipath}/server/v3" >> golang-etcd-devel.file-list echo "%{gopath}/src/%{goipath}/tests/v3" >> golang-etcd-devel.file-list echo "%{gopath}/src/%{goipath}/tools/v3" >> golang-etcd-devel.file-list +echo "%{gopath}/src/%{goipath}/server/v3/etcdserver/api/v3rpc" >> golang-etcd-server-etcdserver-api-v3rpc-devel.file-list %if %{without bootstrap} install -m 0755 -vd %{buildroot}%{_bindir} From 94ad3bdca9503df579d59f73fba632bb9012b772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Tue, 14 Sep 2021 16:57:56 +0200 Subject: [PATCH 26/52] Fix etcd build --- etcd.spec | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/etcd.spec b/etcd.spec index 5f1e899..df6605e 100644 --- a/etcd.spec +++ b/etcd.spec @@ -150,8 +150,8 @@ mv client/v3/README.md README-clientv3.md %if %{without bootstrap} %build -%gobuild -o %{gobuilddir}/bin/etcd %{goipath} -for cmd in etcdctl; do +%gobuild -o %{gobuilddir}/bin/etcd %{goipath}/server +for cmd in etcdctl etcdutl; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done %endif @@ -176,7 +176,6 @@ echo "%{gopath}/src/%{goipath}/raft/v3" >> golang-etcd-devel.file-list echo "%{gopath}/src/%{goipath}/server/v3" >> golang-etcd-devel.file-list echo "%{gopath}/src/%{goipath}/tests/v3" >> golang-etcd-devel.file-list echo "%{gopath}/src/%{goipath}/tools/v3" >> golang-etcd-devel.file-list -echo "%{gopath}/src/%{goipath}/server/v3/etcdserver/api/v3rpc" >> golang-etcd-server-etcdserver-api-v3rpc-devel.file-list %if %{without bootstrap} install -m 0755 -vd %{buildroot}%{_bindir} @@ -202,7 +201,9 @@ install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} -d tests/integration \ -d tests/e2e \ -d tests/integration/client \ - -t tests/integration/clientv3 + -t tests/integration/clientv3 \ + -d server/etcdserver/api/membership \ + -d server/mvcc/backend %endif %endif @@ -214,7 +215,7 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %post %systemd_post %{name}.service -÷ + %preun %systemd_preun %{name}.service From f7b019c0e6e8df047dbcaa91800656624a8f55f2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 02:26:59 +0000 Subject: [PATCH 27/52] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering From b35520b81d103c15cb1f8847b8ff5371cafa4db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sun, 19 Jun 2022 11:05:09 +0200 Subject: [PATCH 28/52] Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191, CVE-2022-29526, CVE-2022-30629 From 376ab7ef79972903cd17d3b5e0a53b557e48611f Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 22 Jun 2022 22:45:24 -0500 Subject: [PATCH 29/52] Rebuild to mitigate CVE-2022-21698 (rhbz#2067400). From 7fa0f757315cc2e3c4b78af985c614c17e680863 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 19 Jul 2022 13:54:59 -0500 Subject: [PATCH 30/52] Rebuild for CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in golang From 3def4ff38d95883b92e32bc65be538e2082823cc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 21 Jul 2022 02:32:43 +0000 Subject: [PATCH 31/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering From 60bdf65bc8e0324b11ad78f0e1f8093cb738c90a Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 10 Aug 2022 11:49:22 -0500 Subject: [PATCH 32/52] Rebuild to fix FTBFS From e4166346b8f780260050765eab875fbe486b3778 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 10 Aug 2022 11:55:29 -0500 Subject: [PATCH 33/52] Rebuild to fix FTBFS From 97cc9275be9f7bae79a840b7e0eec19e0075b0a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sun, 6 Nov 2022 22:13:03 +0100 Subject: [PATCH 34/52] Bootstrap --- .gitignore | 1 + etcd.spec | 180 ++++++++++++++--------------------------------------- sources | 2 +- 3 files changed, 48 insertions(+), 135 deletions(-) diff --git a/.gitignore b/.gitignore index 2bb6f06..f42adf5 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /etcd-3.4.14.tar.gz /man-3.4.14.tar.gz /etcd-3.5.0.tar.gz +/etcd-3.5.5.tar.gz diff --git a/etcd.spec b/etcd.spec index df6605e..c73073c 100644 --- a/etcd.spec +++ b/etcd.spec @@ -1,24 +1,18 @@ -# Generated by go2rpm +# Generated by go2rpm 1.8.2 %bcond_without check -%bcond_with bootstrap +%bcond_without bootstrap +%if %{with bootstrap} +%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$ +%endif # https://github.com/etcd-io/etcd %global goipath go.etcd.io/etcd %global forgeurl https://github.com/etcd-io/etcd -Version: 3.5.0 +Version: 3.5.5 %gometa -%global goipaths0 go.etcd.io/etcd -%global goipathsex0 go.etcd.io/etcd/server/etcdserver/api/v3rpc - -%if %{without bootstrap} -%global goipaths1 go.etcd.io/etcd/server/etcdserver/api/v3rpc -%endif - -%global goaltipaths github.com/coreos/etcd go.etcd.io/etcd/v3 - %global common_description %{expand: Distributed reliable key-value store for the most critical data of a distributed system.} @@ -27,116 +21,40 @@ system.} %global godocs CONTRIBUTING.md README.md Documentation\\\ README-*.md READMEv2-etcdctl.md -%global gosupfiles integration/fixtures/* etcdserver/api/v2http/testdata/* +%global gosupfiles client/v2/example_keys_test.go\\\ + client/v3/clientv3util/example_key_test.go\\\ + client/v3/concurrency/example_election_test.go\\\ + client/v3/concurrency/example_mutex_test.go\\\ + client/v3/concurrency/example_stm_test.go\\\ + client/v3/example_auth_test.go\\\ + client/v3/example_cluster_test.go\\\ + client/v3/example_kv_test.go\\\ + client/v3/example_lease_test.go\\\ + client/v3/example_maintenance_test.go\\\ + client/v3/example_metrics_test.go\\\ + client/v3/example_test.go\\\ + client/v3/example_watch_test.go Name: etcd Release: %autorelease Summary: Distributed reliable key-value store for the most critical data of a distributed system -# Upstream license specification: Apache-2.0 -License: ASL 2.0 +License: Apache-2.0 URL: %{gourl} Source0: %{gosource} Source1: %{name}.service Source2: %{name}.conf -BuildRequires: golang(github.com/bgentry/speakeasy) -# BuildRequires: golang(github.com/cockroachdb/datadriven) -BuildRequires: golang(github.com/coreos/go-semver/semver) -BuildRequires: golang(github.com/coreos/go-systemd/v22/daemon) -BuildRequires: golang(github.com/coreos/go-systemd/v22/journal) -BuildRequires: golang(github.com/creack/pty) -BuildRequires: golang(github.com/dustin/go-humanize) -BuildRequires: golang(github.com/etcd-io/gofail/runtime) -BuildRequires: golang(github.com/form3tech-oss/jwt-go) -BuildRequires: golang(github.com/gogo/protobuf/gogoproto) -BuildRequires: golang(github.com/gogo/protobuf/proto) -BuildRequires: golang(github.com/golang/groupcache/lru) -BuildRequires: golang(github.com/golang/protobuf/descriptor) -BuildRequires: golang(github.com/golang/protobuf/proto) -BuildRequires: golang(github.com/google/btree) -%if %{without bootstrap} -BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-middleware) -BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-middleware/logging/settable) -%endif -BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-prometheus) -BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/runtime) -BuildRequires: golang(github.com/grpc-ecosystem/grpc-gateway/utilities) -BuildRequires: golang(github.com/jonboulle/clockwork) -BuildRequires: golang(github.com/json-iterator/go) -BuildRequires: golang(github.com/modern-go/reflect2) -BuildRequires: golang(github.com/olekukonko/tablewriter) -BuildRequires: golang(github.com/prometheus/client_golang/prometheus) -BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promhttp) -BuildRequires: golang(github.com/soheilhy/cmux) -BuildRequires: golang(github.com/spf13/cobra) -BuildRequires: golang(github.com/spf13/pflag) -BuildRequires: golang(github.com/stretchr/testify/assert) -BuildRequires: golang(github.com/tmc/grpc-websocket-proxy/wsproxy) -BuildRequires: golang(github.com/urfave/cli) -BuildRequires: golang(github.com/xiang90/probing) -BuildRequires: golang(go.etcd.io/bbolt) -BuildRequires: golang(go.opentelemetry.io/contrib-0.20/instrumentation/google.golang.org/grpc/otelgrpc) -BuildRequires: golang(go.opentelemetry.io/otel-0.20/exporters/otlp) -BuildRequires: golang(go.opentelemetry.io/otel-0.20/exporters/otlp/otlpgrpc) -BuildRequires: golang(go.opentelemetry.io/otel-0.20/propagation) -BuildRequires: golang(go.opentelemetry.io/otel-0.20/sdk/resource) -BuildRequires: golang(go.opentelemetry.io/otel-0.20/sdk/trace) -BuildRequires: golang(go.opentelemetry.io/otel-0.20/semconv) -BuildRequires: golang(go.uber.org/multierr) -BuildRequires: golang(go.uber.org/zap) -BuildRequires: golang(go.uber.org/zap/zapcore) -BuildRequires: golang(go.uber.org/zap/zapgrpc) -BuildRequires: golang(go.uber.org/zap/zaptest) -BuildRequires: golang(golang.org/x/crypto/bcrypt) -BuildRequires: golang(golang.org/x/net/http2) -BuildRequires: golang(golang.org/x/net/trace) -BuildRequires: golang(golang.org/x/sys/unix) -BuildRequires: golang(golang.org/x/time/rate) -BuildRequires: golang(google.golang.org/genproto/googleapis/api/annotations) -BuildRequires: golang(google.golang.org/grpc) -BuildRequires: golang(google.golang.org/grpc/codes) -BuildRequires: golang(google.golang.org/grpc/credentials) -BuildRequires: golang(google.golang.org/grpc/grpclog) -BuildRequires: golang(google.golang.org/grpc/health) -BuildRequires: golang(google.golang.org/grpc/health/grpc_health_v1) -BuildRequires: golang(google.golang.org/grpc/keepalive) -BuildRequires: golang(google.golang.org/grpc/metadata) -BuildRequires: golang(google.golang.org/grpc/peer) -BuildRequires: golang(google.golang.org/grpc/resolver) -BuildRequires: golang(google.golang.org/grpc/resolver/manual) -BuildRequires: golang(google.golang.org/grpc/serviceconfig) -BuildRequires: golang(google.golang.org/grpc/status) -BuildRequires: golang(google.golang.org/grpc/test/grpc_testing) -BuildRequires: golang(gopkg.in/cheggaaa/pb.v1) -BuildRequires: golang(gopkg.in/natefinch/lumberjack.v2) -BuildRequires: golang(gopkg.in/yaml.v2) -BuildRequires: golang(sigs.k8s.io/yaml) - -%if %{with check} -# Tests -BuildRequires: golang(github.com/cockroachdb/datadriven) -BuildRequires: golang(github.com/prometheus/client_model/go) -BuildRequires: golang(golang.org/x/sync/errgroup) -%endif - BuildRequires: python3-devel BuildRequires: systemd-rpm-macros Requires(pre): shadow-utils -%description -%{common_description} +%description %{common_description} %gopkg %prep %goprep -k -sed -i \ - -e 's|"go.opentelemetry.io/contrib|"go.opentelemetry.io/contrib-0.20|' \ - $(find . -name '*.go') -sed -i \ - -e 's|"go.opentelemetry.io/otel|"go.opentelemetry.io/otel-0.20|' \ - $(find . -name '*.go') rm -rf vendor/ rm -rf cmd/vendor rm -rf raft/rafttest @@ -148,34 +66,31 @@ mv etcdctl/READMEv2.md READMEv2-etcdctl.md mv client/v2/README.md README-clientv2.md mv client/v3/README.md README-clientv3.md +mkdir -p api/v3/ client/pkg/v3 etcdctl/v3 etcdutl/v3 pkg/v3 raft/v3 server/v3 tools/v3 +shopt -s extglob +mv api/!(v3) api/v3/. +mv client/pkg/!(v3) client/pkg/v3/. +mv etcdctl/!(v3) etcdctl/v3/. +mv etcdutl/!(v3) etcdutl/v3/. +mv pkg/!(v3) pkg/v3/. +mv raft/!(v3) raft/v3/. +mv server/!(v3) server/v3/. +mv tools/!(v3) tools/v3/. +shopt -u extglob + + %if %{without bootstrap} +%generate_buildrequires +%go_generate_buildrequires + %build -%gobuild -o %{gobuilddir}/bin/etcd %{goipath}/server -for cmd in etcdctl etcdutl; do - %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd -done +%gobuild -o %{gobuilddir}/bin/etcd %{goipath}/server/v3 +%gobuild -o %{gobuilddir}/bin/etcdctl %{goipath}/etcdctl/v3 +%gobuild -o %{gobuilddir}/bin/etcdutl %{goipath}/etcdutl/v3 %endif %install %gopkginstall -ln -s %{gopath}/src/%{goipath}/api %{buildroot}%{gopath}/src/%{goipath}/api/v3 -ln -s %{gopath}/src/%{goipath}/client/pkg %{buildroot}%{gopath}/src/%{goipath}/client/pkg/v3 -ln -s %{gopath}/src/%{goipath}/etcdctl %{buildroot}%{gopath}/src/%{goipath}/etcdctl/v3 -ln -s %{gopath}/src/%{goipath}/etcdutl %{buildroot}%{gopath}/src/%{goipath}/etcdutl/v3 -ln -s %{gopath}/src/%{goipath}/pkg %{buildroot}%{gopath}/src/%{goipath}/pkg/v3 -ln -s %{gopath}/src/%{goipath}/raft %{buildroot}%{gopath}/src/%{goipath}/raft/v3 -ln -s %{gopath}/src/%{goipath}/server %{buildroot}%{gopath}/src/%{goipath}/server/v3 -ln -s %{gopath}/src/%{goipath}/tests %{buildroot}%{gopath}/src/%{goipath}/tests/v3 -ln -s %{gopath}/src/%{goipath}/tools %{buildroot}%{gopath}/src/%{goipath}/tools/v3 -echo "%{gopath}/src/%{goipath}/api/v3" >> golang-etcd-devel.file-list -echo "%{gopath}/src/%{goipath}/client/pkg/v3" >> golang-etcd-devel.file-list -echo "%{gopath}/src/%{goipath}/etcdctl/v3" >> golang-etcd-devel.file-list -echo "%{gopath}/src/%{goipath}/etcdutl/v3" >> golang-etcd-devel.file-list -echo "%{gopath}/src/%{goipath}/pkg/v3" >> golang-etcd-devel.file-list -echo "%{gopath}/src/%{goipath}/raft/v3" >> golang-etcd-devel.file-list -echo "%{gopath}/src/%{goipath}/server/v3" >> golang-etcd-devel.file-list -echo "%{gopath}/src/%{goipath}/tests/v3" >> golang-etcd-devel.file-list -echo "%{gopath}/src/%{goipath}/tools/v3" >> golang-etcd-devel.file-list %if %{without bootstrap} install -m 0755 -vd %{buildroot}%{_bindir} @@ -187,27 +102,24 @@ install -pm 644 -t %{buildroot}%{_sysconfdir}/%{name} %{SOURCE2} # And create /var/lib/etcd install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} -%endif -%if %{without bootstrap} %if %{with check} %check %gocheck -d client/v2 \ -d client/v3 \ - -d raft \ - -d server/auth \ - -d server/wal/walpb \ + -d raft/v3 \ + -d server/v3/auth \ + -d server/v3/wal/walpb \ -d tests/e2ev \ -d tests/integration \ -d tests/e2e \ -d tests/integration/client \ -t tests/integration/clientv3 \ - -d server/etcdserver/api/membership \ - -d server/mvcc/backend -%endif + -d server/v3/etcdserver/api/membership \ + -d server/v3/mvcc/backend \ + -d pkg/v3/proxy %endif -%if %{without bootstrap} %pre getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/%{name} \ diff --git a/sources b/sources index 2bb8355..6329787 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (etcd-3.5.0.tar.gz) = ea332fe99c9bce842dc9919b7cf676db2024adf83c23c37dcd8db48bc2a2d3f98879893701644a2317dea69dc15f747f42f5473f14f4343fe7aee9a6b4ebceca +SHA512 (etcd-3.5.5.tar.gz) = 0e1d00a6c94b56cfb5e8f27172e749710938c0891eeaf3257e1dd22722e81d7402d44debb9784a1d330f900203e079956fcfe76e0e16f02a7d891e92f67976da From 5b84a77b93a9f924f39b92112f3f387563bbfd18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sun, 6 Nov 2022 22:25:20 +0100 Subject: [PATCH 35/52] Update to 3.5.5 Close: rhbz# 2045359 rhbz#2014732 --- etcd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index c73073c..0e7422f 100644 --- a/etcd.spec +++ b/etcd.spec @@ -1,6 +1,6 @@ # Generated by go2rpm 1.8.2 %bcond_without check -%bcond_without bootstrap +%bcond_with bootstrap %if %{with bootstrap} %global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$ From 9e3b6a0110bc5fd24a7c38cdcce884543b79908d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 02:49:46 +0000 Subject: [PATCH 36/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering From 083bece85f69f71c335dab89599a1435b071bff4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 19 Jul 2023 19:02:21 +0000 Subject: [PATCH 37/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering From 7a80facf834251d09407b3bb322d97ae5fb15676 Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Tue, 21 Nov 2023 16:43:26 -0600 Subject: [PATCH 38/52] Make CI happy about the include module of Ansible The module ansible.builtin.include was removed in 2.16, and presumably Fedora CI moved on. --- tests/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests.yml b/tests/tests.yml index 4baeb34..28f2cb0 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -1,3 +1,3 @@ --- # Tests for classic environment -- include: e2e_test_from_src_include.yml +- import_playbook: e2e_test_from_src_include.yml From b3c8d414ac00bde2470d8bfac39fd2b1057bb124 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jan 2024 18:38:59 +0000 Subject: [PATCH 39/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 3abe3b4a92b6ec34919f79823ccd528a3461a571 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 24 Jan 2024 10:55:09 +0000 Subject: [PATCH 40/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From bb5bce91f9cdd1967c3eb9502403bc62759e87f8 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Sun, 11 Feb 2024 22:03:15 +0000 Subject: [PATCH 41/52] Rebuild for golang 1.22.0 From 96f23819802642c8e7b2e106498cbf99561847a4 Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Wed, 27 Dec 2023 13:56:48 -0600 Subject: [PATCH 42/52] Update to 3.5.11 --- .gitignore | 1 + etcd.spec | 2 +- sources | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f42adf5..b473a44 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /man-3.4.14.tar.gz /etcd-3.5.0.tar.gz /etcd-3.5.5.tar.gz +/etcd-3.5.11.tar.gz diff --git a/etcd.spec b/etcd.spec index 0e7422f..f17f2d2 100644 --- a/etcd.spec +++ b/etcd.spec @@ -9,7 +9,7 @@ # https://github.com/etcd-io/etcd %global goipath go.etcd.io/etcd %global forgeurl https://github.com/etcd-io/etcd -Version: 3.5.5 +Version: 3.5.11 %gometa diff --git a/sources b/sources index 6329787..48ef4be 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (etcd-3.5.5.tar.gz) = 0e1d00a6c94b56cfb5e8f27172e749710938c0891eeaf3257e1dd22722e81d7402d44debb9784a1d330f900203e079956fcfe76e0e16f02a7d891e92f67976da +SHA512 (etcd-3.5.11.tar.gz) = f131d03146132911841a2a6aaedee2056fb7811ad08032042273e2e4a7ded6c93e0bfd28b69ee69ebb87be60cda2e10fd1429a66f57377157ead1e0e5f8e29ef From deb5f9023466323f7b8deb1cde031f652940ee33 Mon Sep 17 00:00:00 2001 From: Mikel Olasagasti Uranga Date: Tue, 16 Apr 2024 15:49:26 +0200 Subject: [PATCH 43/52] Update to 3.5.13 - Closes rhbz#2225797 rhbz#2171486 rhbz#2170782 rhbz#2236640 rhbz#2243321 rhbz#2248266 rhbz#2251230 --- .gitignore | 1 + etcd.spec | 2 +- sources | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b473a44..e9a97fe 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /etcd-3.5.0.tar.gz /etcd-3.5.5.tar.gz /etcd-3.5.11.tar.gz +/etcd-3.5.13.tar.gz diff --git a/etcd.spec b/etcd.spec index f17f2d2..3290a1d 100644 --- a/etcd.spec +++ b/etcd.spec @@ -9,7 +9,7 @@ # https://github.com/etcd-io/etcd %global goipath go.etcd.io/etcd %global forgeurl https://github.com/etcd-io/etcd -Version: 3.5.11 +Version: 3.5.13 %gometa diff --git a/sources b/sources index 48ef4be..86bef60 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (etcd-3.5.11.tar.gz) = f131d03146132911841a2a6aaedee2056fb7811ad08032042273e2e4a7ded6c93e0bfd28b69ee69ebb87be60cda2e10fd1429a66f57377157ead1e0e5f8e29ef +SHA512 (etcd-3.5.13.tar.gz) = dc85d80079b61e96eb06eb573d41d8972060392e49140a2414c283ea9edfef7b01d5554e50c7ab37c6ad079b373ae12a1b84dbcc533addc1d4d30a2a5abf7b7b From aba0ca8183cec7936761ae7ffa20008cd2f2cdb6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 17 Jul 2024 22:29:15 +0000 Subject: [PATCH 44/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From cc3ffa31a424143616a5ca0edc206abacaee462e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jan 2025 17:32:09 +0000 Subject: [PATCH 45/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From cedaa4496be82a255f0beb1b5481ba3173100320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 11 Feb 2025 14:36:26 +0100 Subject: [PATCH 46/52] Add sysusers.d config file to allow rpm to create users/groups automatically See https://fedoraproject.org/wiki/Changes/RPMSuportForSystemdSysusers. --- etcd.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/etcd.spec b/etcd.spec index 3290a1d..4f0d194 100644 --- a/etcd.spec +++ b/etcd.spec @@ -47,7 +47,6 @@ Source2: %{name}.conf BuildRequires: python3-devel BuildRequires: systemd-rpm-macros -Requires(pre): shadow-utils %description %{common_description} @@ -83,6 +82,11 @@ shopt -u extglob %generate_buildrequires %go_generate_buildrequires +# Create a sysusers.d config file +cat >etcd.sysusers.conf </dev/null || groupadd -r %{name} -getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/%{name} \ - -s /sbin/nologin -c "etcd user" %{name} %post %systemd_post %{name}.service @@ -145,6 +147,7 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/ %endif %gopkgfiles +%{_sysusersdir}/etcd.conf %changelog %autochangelog From de7bba74a6e8fd8199d4fea27f94ee56a7005b09 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 20:09:48 +0000 Subject: [PATCH 47/52] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From df31b2130dc7de32fbb912c226cf0ec9e15c7d98 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 15 Aug 2025 14:36:01 -0500 Subject: [PATCH 48/52] Rebuild for golang-1.25.0 --- etcd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etcd.spec b/etcd.spec index 4f0d194..a259ec8 100644 --- a/etcd.spec +++ b/etcd.spec @@ -36,7 +36,7 @@ system.} client/v3/example_watch_test.go Name: etcd -Release: %autorelease +Release: %autorelease.1 Summary: Distributed reliable key-value store for the most critical data of a distributed system License: Apache-2.0 @@ -150,4 +150,7 @@ install -m0644 -D etcd.sysusers.conf %{buildroot}%{_sysusersdir}/etcd.conf %{_sysusersdir}/etcd.conf %changelog +* Fri Aug 15 2025 Maxwell G - 3.5.13-1.1 +- Rebuild for golang-1.25.0 + %autochangelog From 114cea0b015c28b6991ef0a5c40ce48971712809 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 15 Aug 2025 15:30:33 -0500 Subject: [PATCH 49/52] Revert "Rebuild for golang-1.25.0" This reverts commit df31b2130dc7de32fbb912c226cf0ec9e15c7d98. --- etcd.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/etcd.spec b/etcd.spec index a259ec8..4f0d194 100644 --- a/etcd.spec +++ b/etcd.spec @@ -36,7 +36,7 @@ system.} client/v3/example_watch_test.go Name: etcd -Release: %autorelease.1 +Release: %autorelease Summary: Distributed reliable key-value store for the most critical data of a distributed system License: Apache-2.0 @@ -150,7 +150,4 @@ install -m0644 -D etcd.sysusers.conf %{buildroot}%{_sysusersdir}/etcd.conf %{_sysusersdir}/etcd.conf %changelog -* Fri Aug 15 2025 Maxwell G - 3.5.13-1.1 -- Rebuild for golang-1.25.0 - %autochangelog From 89d8d125c302c37c323d2a53c35d207fab00d1d4 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 15 Aug 2025 16:14:00 -0500 Subject: [PATCH 50/52] Rebuild for golang-1.25.0 From a569b25446f4a05867179139498da00b86ea88f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= Date: Fri, 10 Oct 2025 13:17:41 +0200 Subject: [PATCH 51/52] rebuild From 9dc4a3a2af08f9028363c5800a4481883d0ba3c4 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Sat, 11 Oct 2025 20:54:19 -0500 Subject: [PATCH 52/52] Rebuild for golang 1.25.2