You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature: feature flag "single-term-leader": standard raft mode
With this feature on: only one leader can be elected in each term, but
reduce LogId size from `LogId:{term, node_id, index}` to `LogId{term, index}`.
Add `CommittedLeaderId` as the leader-id type used in `LogId`:
The leader-id used in `LogId` can be different(smaller) from leader-id used
in `Vote`, depending on `LeaderId` definition.
`CommittedLeaderId` is the smallest data that can identify a leader
after the leadership is granted by a quorum(committed).
Change: Vote stores a LeaderId in it.
```rust
// Before
pub struct Vote<NID> {
pub term: u64,
pub node_id: NID,
pub committed: bool,
}
// After
pub struct Vote<NID> {
#[cfg_attr(feature = "serde", serde(flatten))]
pub leader_id: LeaderId<NID>,
pub committed: bool,
}
```
Upgrade tip:
If you manually serialize `Vote`, i.e. without using
`serde`, the serialization part should be rewritten.
Otherwise, nothing needs to be done.
- Fix: #660
0 commit comments