diff --git a/.etcd.metadata b/.etcd.metadata index 1ee7909..9332d79 100644 --- a/.etcd.metadata +++ b/.etcd.metadata @@ -1 +1 @@ -3fe234eef6e02953d40657dfb1b3f612af98f402 SOURCES/etcd-fc00305.tar.gz +c71d0ed1991ab70625f88a60c8a084268e3a4371 SOURCES/etcd-8ba2897.tar.gz diff --git a/.gitignore b/.gitignore index 43090de..a30641b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/etcd-fc00305.tar.gz +SOURCES/etcd-8ba2897.tar.gz diff --git a/SOURCES/bz1350875-disaster-recovery-with-copies.patch b/SOURCES/bz1350875-disaster-recovery-with-copies.patch new file mode 100644 index 0000000..73b69ec --- /dev/null +++ b/SOURCES/bz1350875-disaster-recovery-with-copies.patch @@ -0,0 +1,55 @@ +From e32942895643fbd2db0055b79816e060355d6ca1 Mon Sep 17 00:00:00 2001 +From: Jan Chaloupka +Date: Tue, 21 Feb 2017 12:10:33 +0100 +Subject: [PATCH] bz1350875-disaster-recovery-with-copies + +--- + etcdctl/ctlv2/command/backup_command.go | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/etcdctl/ctlv2/command/backup_command.go b/etcdctl/ctlv2/command/backup_command.go +index 9c7e2ff..0ad6d7a 100644 +--- a/etcdctl/ctlv2/command/backup_command.go ++++ b/etcdctl/ctlv2/command/backup_command.go +@@ -18,6 +18,7 @@ import ( + "fmt" + "log" + "path" ++ "strconv" + "time" + + "github.com/coreos/etcd/etcdserver/etcdserverpb" +@@ -40,6 +41,8 @@ func NewBackupCommand() cli.Command { + cli.StringFlag{Name: "wal-dir", Value: "", Usage: "Path to the etcd wal dir"}, + cli.StringFlag{Name: "backup-dir", Value: "", Usage: "Path to the backup dir"}, + cli.StringFlag{Name: "backup-wal-dir", Value: "", Usage: "Path to the backup wal dir"}, ++ cli.BoolFlag{Name: "keep-cluster-id", Usage: "Do not rewrite the cluster id"}, ++ cli.StringFlag{Name: "node-id", Value: "", Usage: "Use custom node id instead of a random value"}, + }, + Action: handleBackup, + } +@@ -99,8 +102,19 @@ func handleBackup(c *cli.Context) error { + var metadata etcdserverpb.Metadata + pbutil.MustUnmarshal(&metadata, wmetadata) + idgen := idutil.NewGenerator(0, time.Now()) +- metadata.NodeID = idgen.Next() +- metadata.ClusterID = idgen.Next() ++ explicitNodeId := c.String("node-id") ++ if explicitNodeId != "" { ++ metadata.NodeID, err = strconv.ParseUint(explicitNodeId, 16, 64) ++ if err != nil { ++ log.Fatal(err) ++ } ++ } else { ++ metadata.NodeID = idgen.Next() ++ } ++ keepClusterId := c.Bool("keep-cluster-id") ++ if !keepClusterId { ++ metadata.ClusterID = idgen.Next() ++ } + + neww, err := wal.Create(destWAL, pbutil.MustMarshal(&metadata)) + if err != nil { +-- +2.7.4 + diff --git a/SPECS/etcd.spec b/SPECS/etcd.spec index 9217a8c..562dea3 100644 --- a/SPECS/etcd.spec +++ b/SPECS/etcd.spec @@ -21,14 +21,14 @@ # https://github.com/coreos/etcd %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} %global import_path %{provider_prefix} -%global commit fc00305a2e59b4c2d4a53c9fbb4d30741a96ea67 +%global commit 8ba2897a21e4fc51b298ca553d251318425f93ae %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global system_name etcd Name: etcd -Version: 3.0.15 -Release: 1%{?dist} +Version: 3.1.0 +Release: 2%{?dist} Summary: A highly-available key value store for shared configuration License: ASL 2.0 URL: https://%{provider_prefix} @@ -36,6 +36,7 @@ Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar Source1: %{system_name}.service Source2: %{system_name}.conf Patch2: 0001-change-import-paths.patch +Patch3: bz1350875-disaster-recovery-with-copies.patch # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required ExclusiveArch: x86_64 @@ -270,6 +271,8 @@ mv cmd/vendor/* Godeps/_workspace/src/. %patch2 -p1 %endif +%patch3 -p1 + %build mkdir -p src/github.com/coreos ln -s ../../../ src/github.com/coreos/etcd @@ -281,19 +284,17 @@ export GOPATH=$(pwd):$(pwd)/Godeps/_workspace:%{gopath} %endif %if ! 0%{?with_debug} -export LDFLAGS="-X %{import_path}/version.GitSHA %{shortcommit}" +export LDFLAGS="-X %{import_path}/version.GitSHA=%{shortcommit}" %else -export LDFLAGS="-X %{import_path}/version.GitSHA %{shortcommit} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" +export LDFLAGS="-X %{import_path}/version.GitSHA=%{shortcommit} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" %endif -%gobuild -o bin/%{system_name} %{import_path}/cmd +%gobuild -o bin/%{system_name} %{import_path} %gobuild -o bin/%{system_name}ctl %{import_path}/%{system_name}ctl -%gobuild -o bin/%{system_name}-top %{import_path}/tools/%{system_name}-top %install install -D -p -m 0755 bin/%{system_name} %{buildroot}%{_bindir}/%{system_name} install -D -p -m 0755 bin/%{system_name}ctl %{buildroot}%{_bindir}/%{system_name}ctl -install -D -p -m 0755 bin/%{system_name}-top %{buildroot}%{_bindir}/%{system_name}-top install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{system_name}.service install -d -m 0755 %{buildroot}%{_sysconfdir}/%{system_name} install -m 644 -t %{buildroot}%{_sysconfdir}/%{system_name} %{SOURCE2} @@ -410,11 +411,10 @@ getent passwd %{system_name} >/dev/null || useradd -r -g %{system_name} -d %{_sh %files %license LICENSE %doc *.md -%doc cmd/Godeps/Godeps.json +%doc glide.lock %config(noreplace) %{_sysconfdir}/%{system_name} %{_bindir}/%{system_name} %{_bindir}/%{system_name}ctl -%{_bindir}/%{system_name}-top %dir %attr(-,%{system_name},%{system_name}) %{_sharedstatedir}/%{system_name} %{_unitdir}/%{system_name}.service @@ -422,7 +422,7 @@ getent passwd %{system_name} >/dev/null || useradd -r -g %{system_name} -d %{_sh %files devel -f devel.file-list %license LICENSE %doc *.md -%doc cmd/Godeps/Godeps.json +%doc glide.lock %dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} %endif @@ -433,6 +433,16 @@ getent passwd %{system_name} >/dev/null || useradd -r -g %{system_name} -d %{_sh %endif %changelog +* Tue Feb 21 2017 Jan Chaloupka - 3.1.0-2 +- Apply "add --keep-cluster-id and --node-id to 'etcdctl backup'" + from extras-rhel-7.2 branch + resolves: #1350875 + +* Mon Feb 06 2017 Jan Chaloupka - 3.1.0-1 +- Update to 3.1.0 + etcdctl-top removed by upstream + resolves: #1416440 + * Thu Dec 01 2016 jchaloup - 3.0.15-1 - Update to 3.0.15 Obsolete etcd3 < 3.0.15