[Release-7.1] Fix checkall Command Blocking Issue#11146
Merged
Conversation
Contributor
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Contributor
Result of foundationdb-pr on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Contributor
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Contributor
Result of foundationdb-pr-clang on Linux CentOS 7
|
flowguru
suggested changes
Jan 25, 2024
Contributor
|
I am having a hard time understanding how the spawn new range works.. will discuss offline |
jzhou77
reviewed
Jan 25, 2024
| } | ||
|
|
||
| printf("Checking complete.\n"); | ||
| // The command is used to check the inconsistency in a keyspace, default is \xff\x02/blog/ keyspace. |
Contributor
There was a problem hiding this comment.
We can remove ", default is \xff\x02/blog/ keyspace" now.
| printable(beginKeyToCheck).c_str(), | ||
| printable(claimEndKey).c_str(), | ||
| hasMore); | ||
| if (claimEndKey.empty()) { |
Contributor
There was a problem hiding this comment.
If the key range is indeed empty, this will be empty. In this case, this function should simply return true.
Member
Author
There was a problem hiding this comment.
We cannot return, but we can skip the shard.
Member
Author
We have discussed all concerns offline and will add more comments to the code. |
Contributor
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Contributor
Result of foundationdb-pr on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
flowguru
approved these changes
Jan 25, 2024
Contributor
Result of foundationdb-pr-clang on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Contributor
Result of foundationdb-pr on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Contributor
Result of foundationdb-pr-clang on Linux CentOS 7
|
jzhou77
approved these changes
Jan 26, 2024
Contributor
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Contributor
Result of foundationdb-pr on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Contributor
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Contributor
Result of foundationdb-pr-clang on Linux CentOS 7
|
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.
Consider two storage servers:
SS1: 1,2,3,4
SS2: 1
The output of checkall should be 2,3,4 as the unique key of SS1.
However, the checkall gets stuck in this case.
WLOG, suppose the checkall read batch is 2 at a time.
In the first step, the beginKey is 1; 1 and 2 are read from SS1 and 1 is read from SS2; The checker sets 1 as the nextBeginKey.
In the second step, the beginKey is still 1 => the checker gets stuck --- repeatedly access to the beginKey 1.
To avoid this issue, if the checkall algorithms finds that the nextBeginKey remains the same as the beginKey of the current round, the checkall splits the remaining range into two subRanges, where the maximum endKey of the current round is the pivot. In this example:
In the second step, the checkall finds beginKey == nextBeginKey. Then, the checkall spawns a child checkall to check for the inputRange of 1~2.
In the third step, the beginKey is 2; SS1 replies [empty], and SS2 replies 2, 3; The nextBeginKey is 3...
Code-Reviewer Section
The general pull request guidelines can be found here.
Please check each of the following things and check all boxes before accepting a PR.
For Release-Branches
If this PR is made against a release-branch, please also check the following:
release-branchormainif this is the youngest branch)