Skip to content

Commit

Permalink
Merge pull request etcd-io#5960 from xiang90/a_i
Browse files Browse the repository at this point in the history
etcdserver: set applied index correctly
  • Loading branch information
xiang90 authored Jul 17, 2016
2 parents d9e939d + 2d761d6 commit 336e4f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion etcdserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@ func (s *EtcdServer) applyEntryNormal(e *raftpb.Entry) {
s.consistIndex.setConsistentIndex(e.Index)
shouldApplyV3 = true
}
defer s.setAppliedIndex(e.Index)

// raft state machine may generate noop entry when leader confirmation.
// skip it in advance to avoid some potential bug in the future
Expand Down Expand Up @@ -1082,7 +1083,6 @@ func (s *EtcdServer) applyEntryNormal(e *raftpb.Entry) {
if s.w.IsRegistered(id) || !noSideEffect(&raftReq) {
ar = s.applyV3.Apply(&raftReq)
}
s.setAppliedIndex(e.Index)

if ar == nil {
return
Expand Down

0 comments on commit 336e4f2

Please sign in to comment.