etcdserver: handle proposal error when processing internal raft request

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
nolouch 2018-04-10 00:49:58 +08:00 committed by Gyuho Lee
parent 89c58b6f7a
commit 3c52342b37

View File

@ -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()