-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Remove redundant storage of last-quorum-acked-time in Leadi…
…ng.vote Previously, `Leading.vote.utime()` held the last timestamp acknowledged by a quorum, marking the beginning of the leader lease. The `Leading` struct updates and calculates this timestamp upon receiving an `AppendEntries` reply (includes heartbeat) from a follower. However, the leader's own timestamp was not being updated in this process. With this commit, we now update the leader's timestamp every time the **last-quorum-acked-time** is accessed. This constant recalculation makes storing the timestamp in `Leading.vote` unnecessary, hence it has been removed to streamline the code.
- Loading branch information
1 parent
f2c3e05
commit fde9d05
Showing
4 changed files
with
108 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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