raftstore: fix lost request vote messages during split#8454
raftstore: fix lost request vote messages during split#8454overvenus merged 5 commits intotikv:masterfrom
Conversation
Signed-off-by: Neil Shen <overvenus@gmail.com>
Signed-off-by: Neil Shen <overvenus@gmail.com>
|
Rest LGTM |
|
@NingLin-P,Thanks for your review. However, LGTM is restricted to Reviewers or higher roles.See the corresponding SIG page for more information. Related SIGs: raft(slack). |
There was a problem hiding this comment.
Good catch! The cost of losing request vote messages is very high.
Since the check_msg has verified that message is newer and a new peer can be created, I think it's better to save this message if maybe_create_peer returns Ok(false)?
Also, remember to remove some code in maybe_create_peer that adds this msg to pending_votes.
Signed-off-by: Neil Shen <overvenus@gmail.com>
|
Better to open an individual issue to describe the bug. |
gengliqi
left a comment
There was a problem hiding this comment.
is_first_vote seems a little strange. But I also have no good idea😑.
| } | ||
| } | ||
| is_first_vote |
There was a problem hiding this comment.
| } | |
| } | |
| is_first_vote | |
| } | |
| is_first_vote | |
| } | |
| false |
Signed-off-by: Neil Shen <overvenus@gmail.com>
|
@NingLin-P,Thanks for your review. However, LGTM is restricted to Reviewers or higher roles.See the corresponding SIG page for more information. Related SIGs: raft(slack). |
Signed-off-by: gengliqi <gengliqiii@gmail.com>
What problem does this PR solve?
Fix #8456, request vote messages are lost during split, which is introduced by #8084.
This PR improve TiDB 99.999% Txn duration from 15s to 1s.
What is changed and how it works?
Cache vote message into pending votes, so that new peer can response ASAP.
Related changes
Check List
Tests
Release note