Browse Source

raftexample: confState should be saved after apply

Vincent Lee 9 years ago
parent
commit
e8d06d8e4d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      contrib/raftexample/raft.go

+ 1 - 1
contrib/raftexample/raft.go

@@ -155,7 +155,7 @@ func (rc *raftNode) publishEntries(ents []raftpb.Entry) bool {
 		case raftpb.EntryConfChange:
 			var cc raftpb.ConfChange
 			cc.Unmarshal(ents[i].Data)
-			rc.node.ApplyConfChange(cc)
+			rc.confState = *rc.node.ApplyConfChange(cc)
 			switch cc.Type {
 			case raftpb.ConfChangeAddNode:
 				if len(cc.Context) > 0 {