From b38e138baf17e1ac742d34ed63d72f777e1a1bfe Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Tue, 10 Apr 2018 13:59:40 -0700 Subject: [PATCH] etcdserver: handle raft Propose error in v2 applier Handle "raft.ErrProposalDropped" as in v3 applier. Signed-off-by: Gyuho Lee --- etcdserver/v2_server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etcdserver/v2_server.go b/etcdserver/v2_server.go index 1be5650f607..25728259cfb 100644 --- a/etcdserver/v2_server.go +++ b/etcdserver/v2_server.go @@ -101,7 +101,12 @@ func (a *reqV2HandlerEtcdServer) processRaftRequest(ctx context.Context, r *Requ ch := a.s.w.Register(r.ID) start := time.Now() - a.s.r.Propose(ctx, data) + err = a.s.r.Propose(ctx, data) + if err != nil { + proposalsFailed.Inc() + a.s.w.Trigger(r.ID, nil) + return Response{}, err + } proposalsPending.Inc() defer proposalsPending.Dec()