baidu / baidu/braft

Pre-Vote相关问题

Open
#154 3 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

在PreVote的逻辑中,节点使用current_term+1发起投票,其它的节点判断如果PreVote的request.LogId >= this.LogId就投票。考虑这样的场景:
3个节点ABC,A leader, B和C是follower。某个时间段,C与AB网络隔离,C发起PreVote,当ABC网络恢复时,A和B会投票给C,那么C就会elect_self,进而成为主。

请参考[修复PreVote流程的疑似bug](https://github.com/sofastack/sofa-jraft/issues/15#issuecomment-471527807)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the linked SOFA JRaft discussion and tracing braft's PreVote request handling and vote-granting logic. Reproduce the three-node A/B/C partition and recovery scenario described here, then verify that a previously isolated follower cannot become leader solely from a PreVote using the newer term; add or update a regression test if the relevant test location is found.

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
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.