raftstore: rely on the all-target-peer-exist guarantee during merging (#7672)#8003
Closed
sre-bot wants to merge 2 commits intotikv:release-3.1from
Closed
raftstore: rely on the all-target-peer-exist guarantee during merging (#7672)#8003sre-bot wants to merge 2 commits intotikv:release-3.1from
sre-bot wants to merge 2 commits intotikv:release-3.1from
Conversation
Signed-off-by: sre-bot <sre-bot@pingcap.com>
Contributor
Author
|
/run-all-tests |
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
BusyJay
approved these changes
Jun 3, 2020
Connor1996
approved these changes
Jun 4, 2020
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cherry-pick #7672 to release-3.1
Signed-off-by: Liqi Geng gengliqiii@gmail.com
What problem does this PR solve?
Problem Summary:
In the past, we assume some target peers may not exist during merging. It introduces many complexities that we need to think about how to handle it.
Also, there are some cases we can not handle.
For example, a target peer does not exist during merging. Its corresponding source peer is waiting for it to be created. Then other target peers do the conf change and remove it(though it never existed). Next, the target region merges to another target region.
In this case, the waiting source peer can not find out whether it should be removed. (It's very difficult, the PD knows nothing because the target region has merged to another one)
Luckily, in tikv/pd#839 (the earliest PR about merging in PD), it checks the target peer's pending peer count must equal to zero.
So we can rely on the all-target-peer-exist guarantee to make it easier and save our brain power.
What is changed and how it works?
What's Changed:
Rely on the all-target-peer-exist guarantee during merging.
Remove some code about handling some cases when a target peer may not exist during merging.
Related changes
Check List
Tests
Side effects
We should check it twice whether the earliest version can give us this guarantee.
Otherwise, it will break backward compatibility.
Release note