Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

heartbeat(serverId, term, lastLogId, lastLogTerm): used to inform passive servers that there is a leader and that the leader is alive and well. ServerId is the id of the leader. The lastlogId and lastLogTerm arguments specify the id and term from the leader's last log entry; if these don't match the last log entry in the recipient, then it returns the id and term from its last log entry so that leader can replay missing entries.

requestVote(serverId, term, lastLogId, lastLogTerm): used by a candidate to request another server's vote for termServerId is the id of the requestor, and lastLogId and lastLogTerm specify the id and term from the requestor's last log entry; if either of the recipient's corresponding items is larger then it means the requestor's log is not complete enough for it to become the new leader.

...