|
@@ -1272,9 +1272,14 @@ func (s *EtcdServer) apply(es []raftpb.Entry, confState *raftpb.ConfState) (appl
|
|
|
case raftpb.EntryNormal:
|
|
case raftpb.EntryNormal:
|
|
|
s.applyEntryNormal(&e)
|
|
s.applyEntryNormal(&e)
|
|
|
case raftpb.EntryConfChange:
|
|
case raftpb.EntryConfChange:
|
|
|
|
|
+ // set the consistent index of current executing entry
|
|
|
|
|
+ if e.Index > s.consistIndex.ConsistentIndex() {
|
|
|
|
|
+ s.consistIndex.setConsistentIndex(e.Index)
|
|
|
|
|
+ }
|
|
|
var cc raftpb.ConfChange
|
|
var cc raftpb.ConfChange
|
|
|
pbutil.MustUnmarshal(&cc, e.Data)
|
|
pbutil.MustUnmarshal(&cc, e.Data)
|
|
|
removedSelf, err := s.applyConfChange(cc, confState)
|
|
removedSelf, err := s.applyConfChange(cc, confState)
|
|
|
|
|
+ s.setAppliedIndex(e.Index)
|
|
|
shouldStop = shouldStop || removedSelf
|
|
shouldStop = shouldStop || removedSelf
|
|
|
s.w.Trigger(cc.ID, &confChangeResponse{s.cluster.Members(), err})
|
|
s.w.Trigger(cc.ID, &confChangeResponse{s.cluster.Members(), err})
|
|
|
default:
|
|
default:
|