Fix transaction_too_old error when version vector is enabled#8710
Merged
Conversation
When VV is enabled, the comparison of storage server version and read version should use the original read version, otherwise, the client may get the wrong transaction_too_old error.
Collaborator
Doxense CI Report for Windows 10
|
Contributor
Result of foundationdb-pr-macos-m1 on macOS BigSur 11.5.2
|
Contributor
Result of foundationdb-pr-clang on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-macos on macOS Monterey 12.x
|
Collaborator
Doxense CI Report for Windows 10
|
Contributor
Result of foundationdb-pr on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-clang on Linux CentOS 7
|
Contributor
Result of foundationdb-pr on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
sbodagala
reviewed
Nov 7, 2022
jzhou77
marked this pull request as draft
November 7, 2022 21:33
Collaborator
Author
|
Changed the return value of 500k 20221107-224558-jzhou-0ff337f1652a9d5e. 3 failures are not using version vector, so should be unrelated. |
Contributor
Result of foundationdb-pr-macos on macOS Monterey 12.x
|
Collaborator
Doxense CI Report for Windows 10
|
Contributor
Result of foundationdb-pr-clang on Linux CentOS 7
|
Contributor
Result of foundationdb-pr on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-clang on Linux CentOS 7
|
Contributor
Result of foundationdb-pr on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Contributor
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
jzhou77
marked this pull request as ready for review
November 8, 2022 00:46
Contributor
|
What test surfaced this problem? |
sbodagala
reviewed
Nov 8, 2022
| if (data->version.get() < readVersion) { | ||
| // Majority of the case, try using higher version to avoid | ||
| // transaction_too_old error when oldestVersion advances. | ||
| return data->version.get(); // majority of cases |
Contributor
There was a problem hiding this comment.
I like this solution. This is correct because this storage server doesn't have any newer commits in the range (commitVersion, readVersion] and so can read at any version in this range.
sbodagala
reviewed
Nov 8, 2022
sbodagala
previously approved these changes
Nov 8, 2022
sbodagala
reviewed
Nov 8, 2022
Collaborator
Author
A simulation test found this: commit: 333a8bf |
sbodagala
approved these changes
Nov 8, 2022
Contributor
Result of foundationdb-pr-clang on Linux CentOS 7
|
Contributor
Result of foundationdb-pr on Linux CentOS 7
|
Collaborator
Doxense CI Report for Windows 10
|
Contributor
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
dlambrig
approved these changes
Nov 8, 2022
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.
Cherrypick #8745
When VV is enabled,
the comparison of storage server version and read version should use the original read version, otherwise, the client may get the wrong transaction_too_old error. In the failed seed, this prevents the consistency check from finishing.thewaitForVersion()may use the oldest version in the MVCC window as the actual read version, which may often result in thetransaction_too_oldif the MVCC moved, especially during areadRange(). The change here is to try using a higher read version that is still valid, but not likely to causetransaction_too_olderror.commit: 333a8bf
seed: -f ./foundationdb/tests/fast/MutationLogReaderCorrectness.toml -s 728034139 -b on
clang
500k 20221105-190436-jzhou-52ae8ebf0861e8bd passed.
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)