_leader_lease should also be considered when handling vote
- Dominant language
- C++
- Stars
- 4.2k
- Forks
- 923
- PR merge metrics
- No merged PRs in 30d
Description
Currently only `_follower_lease` is considered, and leader will never update `_follower_lease`, so `_follower_lease` will always expire on leader side. If a follower starts election in an idle group, leader will vote for follower even the leader lease is still valid. Leader will call `step_down` to invalidate `_leader_lease` before vote, so there seems to be no correctness problem. But if a follower is isolated for a while and then return, it's likely to cause leadership change and lead to latency jitter on the client side.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the vote-handling path and the code that manages _follower_lease and _leader_lease. Read how step_down invalidates _leader_lease before a vote, then trace the idle-group and returning-follower cases described here. Done means vote handling accounts for the valid leader lease without introducing leadership-change latency jitter.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100