From 1415e8dd281a4e357d96c494a1ae270ff079ec04 Mon Sep 17 00:00:00 2001 From: nolouch Date: Tue, 10 Apr 2018 00:49:58 +0800 Subject: [PATCH] etcdserver: handle proposal error when processing internal raft request --- 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 b3f773274e1e..9a543d807498 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 failed + return nil, err + } proposalsPending.Inc() defer proposalsPending.Dec()