baidu / baidu/braft

有没有可能出现两次选举成功的间隔小于election_timeout导致lease read失效?

Open
#405 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
4.2k
Forks
923
PR merge metrics
No merged PRs in 30d

Description

如下case:

三节点{A, B, C}

```
1. A向BC请求投票
2. BC都成功给A投票
3. B选举超时,开始preVote
4. A当选为Leader (Term=1),之后开始向BC发送心跳
5. B向AC请求投票
6. C成给B投票
7. B当选为Leader(Term=2)
```

follower在handleRequestVoteRequest中vote成功时,并没有renew follower_lease。这种情况下follower(B)在vote成功后会立即开始新的一轮选举,导致AB两个node在很短时间内先后当选为Leader

会有这种情况发生吗?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading handleRequestVoteRequest and the follower_lease and election_timeout handling. Reproduce the described three-node sequence and determine whether two leaders can be elected within one election timeout and whether lease reads then become invalid; the issue is done when this behavior is confirmed or ruled out.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.