raftstore: handle the race between creating new peer and splitting correctly#8084
Merged
ti-srebot merged 44 commits intotikv:masterfrom Jul 29, 2020
Merged
raftstore: handle the race between creating new peer and splitting correctly#8084ti-srebot merged 44 commits intotikv:masterfrom
ti-srebot merged 44 commits intotikv:masterfrom
Conversation
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
2359dd5 to
f5ad852
Compare
NingLin-P
reviewed
Jun 16, 2020
Comment on lines
+1952
to
+1954
| regions, | ||
| derived, | ||
| new_regions_map, |
Member
There was a problem hiding this comment.
regions and new_regions_map looks duplicated, could we just remove all regions that don't need to split from regions?
Member
Author
There was a problem hiding this comment.
I consider it before. But the regions is also used in resp. I don't know what's its effect yet.
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
4352245 to
c69c25b
Compare
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
BusyJay
reviewed
Jun 18, 2020
NingLin-P
reviewed
Jun 18, 2020
NingLin-P
reviewed
Jun 18, 2020
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
92f24df to
91d79c6
Compare
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
91d79c6 to
cefbaf8
Compare
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
9fd8790 to
d3e4a8a
Compare
Member
Author
|
/merge |
Contributor
|
Your auto merge job has been accepted, waiting for:
|
Contributor
|
/run-all-tests |
Contributor
|
@gengliqi merge failed. |
Member
Author
|
/merge |
Contributor
|
/run-all-tests |
Contributor
|
@gengliqi merge failed. |
Member
Author
|
/run-all-tests |
Member
Author
|
/merge |
Contributor
|
/run-all-tests |
ti-chi-bot
pushed a commit
that referenced
this pull request
Jan 14, 2021
) ### What problem does this PR solve? Issue Number: close #8783 Problem Summary: #8783 (comment) The bug is located in function `on_ready_split_region` which is introduced by #8084. https://github.com/tikv/tikv/blob/7c9850040ba58d48f0f1a93345c0392dffb2fc5b/components/raftstore/src/store/fsm/peer.rs#L2084-L2112 Line 2111 `continue` means this region has already existed so it should be skipped. But line 2087-2090 has already added this region to `region_ranges` which leads to metadata inconsistency. ### What is changed and how it works? What's Changed: Fix this bug and add 2 tests. Run `test_split_not_to_split_existed_tombstone_region ` and `test_split_not_to_split_existed_different_uninitialied_peer` can panic in different place in previous code. ### Related changes - Need to cherry-pick to the release branch ### Check List <!--REMOVE the items that are not applicable--> Tests <!-- At least one of them must be included. --> - Integration test Side effects - No ### Release note <!-- bugfixes or new feature need a release note --> * No release note
gengliqi
added a commit
to gengliqi/tikv
that referenced
this pull request
Jan 26, 2021
Signed-off-by: gengliqi <gengliqiii@gmail.com>
ti-chi-bot
pushed a commit
that referenced
this pull request
Jul 13, 2021
9 tasks
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.
Signed-off-by: Liqi Geng gengliqiii@gmail.com
What problem does this PR solve?
Problem Summary:
The new region which is created by splitting may has already created before in some sophisticated cases.
I tried to fix it by changing the split flow. close #7503
But it's too complicated and slower than before.
With @NingLin-P's help, this new method for this PR is to add a new
pending_create_peers. It has lower performance loss than the previous fix PR.What is changed and how it works?
What's Changed:
Add
StoreMetato ApplyContext to handle the race of creating peer and splitting.The test will be added.
Related changes
Tests
Side effects
No.
Release note