-
-
Save sttts/cfdc7c89cb7bfbef6c8e7ec0c80274e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/raft/raft.go b/raft/raft.go | |
| index 281ea01..60733b6 100644 | |
| --- a/raft/raft.go | |
| +++ b/raft/raft.go | |
| @@ -275,6 +275,13 @@ func (r *raft) sendAppend(to uint64) { | |
| pr.becomeSnapshot(sindex) | |
| r.logger.Debugf("%x paused sending replication messages to %x [%s]", r.id, to, pr) | |
| } else { | |
| + start := pr.Next | |
| + if len(ents) != 0 { | |
| + start = ents[0].Index | |
| + } | |
| + r.logger.Debugf("%x [firstindex: %d, commit: %d] send append[index: %d - %d, term: %d] to %x [%s]", | |
| + r.id, r.raftLog.firstIndex(), r.Commit, start, start + uint64(len(ents)), term, to, pr) | |
| + | |
| m.Type = pb.MsgApp | |
| m.Index = pr.Next - 1 | |
| m.LogTerm = term |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment