Browse Source

Merge pull request #10945 from tbg/add-todo

raft: leave TODO about leaving StateSnapshot
Gyuho Lee 6 years ago
parent
commit
936c506e8d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      raft/raft.go

+ 3 - 0
raft/raft.go

@@ -1093,6 +1093,9 @@ func stepLeader(r *raft, m pb.Message) error {
 				case pr.State == tracker.StateProbe:
 				case pr.State == tracker.StateProbe:
 					pr.BecomeReplicate()
 					pr.BecomeReplicate()
 				case pr.State == tracker.StateSnapshot && pr.Match >= pr.PendingSnapshot:
 				case pr.State == tracker.StateSnapshot && pr.Match >= pr.PendingSnapshot:
+					// TODO(tbg): we should also enter this branch if a snapshot is
+					// received that is below pr.PendingSnapshot but which makes it
+					// possible to use the log again.
 					r.logger.Debugf("%x recovered from needing snapshot, resumed sending replication messages to %x [%s]", r.id, m.From, pr)
 					r.logger.Debugf("%x recovered from needing snapshot, resumed sending replication messages to %x [%s]", r.id, m.From, pr)
 					// Transition back to replicating state via probing state
 					// Transition back to replicating state via probing state
 					// (which takes the snapshot into account). If we didn't
 					// (which takes the snapshot into account). If we didn't