ソースを参照

contrib/raftexample: Publish only committed entries

We shouldn't publish entries to the kvstore until they've been
committed.
Adam Wolfe Gordon 10 年 前
コミット
a31f9a8af1
1 ファイル変更1 行追加1 行削除
  1. 1 1
      contrib/raftexample/raft.go

+ 1 - 1
contrib/raftexample/raft.go

@@ -228,7 +228,7 @@ func (rc *raftNode) serveChannels() {
 			rc.wal.Save(rd.HardState, rd.Entries)
 			rc.raftStorage.Append(rd.Entries)
 			rc.transport.Send(rd.Messages)
-			if ok := rc.publishEntries(rd.Entries); !ok {
+			if ok := rc.publishEntries(rd.CommittedEntries); !ok {
 				rc.stop()
 				return
 			}