Skip to content

Commit

Permalink
Document Raft.send method.
Browse files Browse the repository at this point in the history
The change makes it explicit that sending messages does not happen
immidietely and is subject to proper persist & then send protocol
on the application side. See:

etcd-io#12589 (comment)

for more context.
  • Loading branch information
ptabor committed Jan 15, 2021
1 parent 58f78df commit bf6f173
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion raft/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ func (r *raft) hardState() pb.HardState {
}
}

// send persists state to stable storage and then sends to its mailbox.
// send schedules persisting state to a stable storage and AFTER that
// sending the message (as part of next Ready message processing).
func (r *raft) send(m pb.Message) {
if m.From == None {
m.From = r.id
Expand Down

0 comments on commit bf6f173

Please sign in to comment.