Skip to content

Commit

Permalink
etcdserver: handle raft Propose error in v2 applier
Browse files Browse the repository at this point in the history
Handle "raft.ErrProposalDropped" as in v3 applier.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Apr 10, 2018
1 parent 170c8bb commit 489f374
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion etcdserver/v2_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 489f374

Please sign in to comment.