Commit 68a7a9e 1 parent f64d156 commit 68a7a9e Copy full SHA for 68a7a9e
File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1785,6 +1785,11 @@ func (r *raft) handleAppendEntries(m pb.Message) {
1785
1785
func (r * raft ) handleHeartbeat (m pb.Message ) {
1786
1786
// It is only safe to advance the commit index if our log is a prefix of the
1787
1787
// leader's log. Otherwise, entries at this index may mismatch.
1788
+ //
1789
+ // TODO(pav-kv): move this logic to r.raftLog, which is more appropriate for
1790
+ // handling safety. The raftLog can use the logSynced flag for other safety
1791
+ // checks. For example, unstable.truncateAndAppend currently may override a
1792
+ // suffix of the log unconditionally, but it can only be done if !logSynced.
1788
1793
if r .logSynced {
1789
1794
r .raftLog .commitTo (min (m .Commit , r .raftLog .lastIndex ()))
1790
1795
}
You can’t perform that action at this time.
0 commit comments