Document Raft.send method.

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:

https://github.com/etcd-io/etcd/issues/12589#issuecomment-752867024

for more context.
This commit is contained in:
Piotr Tabor 2021-01-05 13:23:06 +01:00
parent 58f78df1de
commit bf6f173d5e

View File

@ -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