From a31f9a8af14ea3d77bba83aa0fd121da649bf234 Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Fri, 5 Feb 2016 11:17:15 -0700 Subject: [PATCH] contrib/raftexample: Publish only committed entries We shouldn't publish entries to the kvstore until they've been committed. --- contrib/raftexample/raft.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/raftexample/raft.go b/contrib/raftexample/raft.go index 9475812c6..439d7f1d6 100644 --- a/contrib/raftexample/raft.go +++ b/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 }