Refactor: Add Leader Lease Duration into RaftState.vote
This commit enhances the management of leader lease durations by
integrating them directly into the RaftState.vote structure.
Previously, the leader lease was managed separately as a configuration
parameter, and RaftState.vote only recorded the timestamp of the last
received AppendEntries RPC.
Store the lease duration together with the last update time in
RaftState.vote, we simplify the process of expiration checking and
improve the clarity of state logging.
Dynamic Lease Management: This integration allows the lease duration
to be reset dynamically, which is particularly useful when a
leadership transfer is scheduled. This capability ensures that the
leader's expiration can be immediately considered without delay.
Runtime Adjustments: Leaders can now adjust their lease durations
at runtime as needed, without requiring a configuration update. This
flexibility supports more responsive and adaptable leadership
management within the Raft cluster.
Rename UTime to Leased and add field lease and related methods.
Changelog
Refactor: Add Leader Lease Duration into
RaftState.vote
This commit enhances the management of leader lease durations by integrating them directly into the
RaftState.vote
structure. Previously, the leader lease was managed separately as a configuration parameter, andRaftState.vote
only recorded the timestamp of the last receivedAppendEntries
RPC.Store the lease duration together with the last update time in
RaftState.vote
, we simplify the process of expiration checking and improve the clarity of state logging.Dynamic Lease Management: This integration allows the lease duration to be reset dynamically, which is particularly useful when a leadership transfer is scheduled. This capability ensures that the leader's expiration can be immediately considered without delay.
Runtime Adjustments: Leaders can now adjust their lease durations at runtime as needed, without requiring a configuration update. This flexibility supports more responsive and adaptable leadership management within the Raft cluster.
Rename
UTime
toLeased
and add fieldlease
and related methods.This change is