From 3c52342b379e6c47507233285dce26f93a17d4f9 Mon Sep 17 00:00:00 2001 From: nolouch Date: Tue, 10 Apr 2018 00:49:58 +0800 Subject: [PATCH 1/2] etcdserver: handle proposal error when processing internal raft request Signed-off-by: Gyuho Lee --- etcdserver/v3_server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etcdserver/v3_server.go b/etcdserver/v3_server.go index b3f773274e1..ea9f174ea60 100644 --- a/etcdserver/v3_server.go +++ b/etcdserver/v3_server.go @@ -582,7 +582,12 @@ func (s *EtcdServer) processInternalRaftRequestOnce(ctx context.Context, r pb.In defer cancel() start := time.Now() - s.r.Propose(cctx, data) + err = s.r.Propose(cctx, data) + if err != nil { + proposalsFailed.Inc() + s.w.Trigger(id, nil) // GC wait + return nil, err + } proposalsPending.Inc() defer proposalsPending.Dec() From e75d06d93234803c2fb2327f927955d1d5e12707 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Mon, 9 Apr 2018 14:47:07 -0700 Subject: [PATCH 2/2] CHANGELOG-3.4: highlight etcd server "raft.ErrProposalDropped" return Signed-off-by: Gyuho Lee --- CHANGELOG-3.4.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index 119523f60bb..9feb7727bbb 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -30,6 +30,8 @@ See [code changes](https://github.com/coreos/etcd/compare/v3.3.0...v3.4.0) and [ - Futhermore, when `--auto-compaction-mode=periodic --auto-compaction-retention=30m` and writes per minute are about 1000, `v3.3.0`, `v3.3.1`, and `v3.3.2` compact revision 30000, 33000, and 36000, for every 3-minute, while `v3.3.3` *or later* compacts revision 30000, 60000, and 90000, for every 30-minute. - Improve [lease expire/revoke operation performance](https://github.com/coreos/etcd/pull/9418), address [lease scalability issue](https://github.com/coreos/etcd/issues/9496). - Make [Lease `Lookup` non-blocking with concurrent `Grant`/`Revoke`](https://github.com/coreos/etcd/pull/9229). +- Make [etcd server return `raft.ErrProposalDropped` on internal Raft proposal drop](https://github.com/coreos/etcd/pull/9549). + - e.g. a node is removed from cluster, [ongoing leadership transfer](https://github.com/coreos/etcd/issues/8975). - Improve [functional tester](https://github.com/coreos/etcd/tree/master/functional) coverage: use [proxy layer to run network fault tests in CI](https://github.com/coreos/etcd/pull/9081), enable [TLS both for server and client](https://github.com/coreos/etcd/pull/9534), add [liveness mode](https://github.com/coreos/etcd/issues/9230), and [shuffle test sequence](https://github.com/coreos/etcd/issues/9381). ### Breaking Changes @@ -158,7 +160,7 @@ See [security doc](https://github.com/coreos/etcd/blob/master/Documentation/op-g - Fix [deadlock during PreVote migration process](https://github.com/coreos/etcd/pull/8525). - Add [`raft.ErrProposalDropped`](https://github.com/coreos/etcd/pull/9067). - Now [`(r *raft) Step` returns `raft.ErrProposalDropped`](https://github.com/coreos/etcd/pull/9137) if a proposal has been ignored. - - e.g. a node is removed from cluster, [ongoing leadership transfer](https://github.com/coreos/etcd/issues/8975), etc. + - e.g. a node is removed from cluster, [ongoing leadership transfer](https://github.com/coreos/etcd/issues/8975). - Improve [Raft `becomeLeader` and `stepLeader`](https://github.com/coreos/etcd/pull/9073) by keeping track of latest `pb.EntryConfChange` index. - Previously record `pendingConf` boolean field scanning the entire tail of the log, which can delay hearbeat send. - Fix [missing learner nodes on `(n *node) ApplyConfChange`](https://github.com/coreos/etcd/pull/9116).