-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kv/storage: introduce local timestamps for MVCC versions in MVCCValue #80706
Merged
craig
merged 9 commits into
cockroachdb:master
from
nvanbenschoten:nvanbenschoten/localTimestampValue
May 9, 2022
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f52ecd6
kv: don't consult synthetic timestamp bit before commit-wait
nvanbenschoten 186e9a8
kv: introduce and plumb intent resolution "pending observations"
nvanbenschoten ed68bfb
kv: plumb LeaseStatus into batch evaluation
nvanbenschoten d5b3fe7
kv: plumb local timestamp into MVCC
nvanbenschoten 24c56df
kv/storage: introduce local timestamps for MVCC versions in MVCCValue
nvanbenschoten 1bcf950
kv/storage: add cluster version gates for local timestamp
nvanbenschoten a3e608d
storage: store encoded MVCCValues in SequencedIntents
nvanbenschoten 52de4f9
kv/uncertainty: assert that value and local timestamp are non-zero
nvanbenschoten 720c8cf
storage: disable simple MVCC value encoding scheme under metamorphic …
nvanbenschoten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nvanbenschoten: To confirm that I understand the idea here, we're saying "we want to move the local timestamp of an intent as close as possible to its mvcc commit timestamp". Is that fair to say?
In other words, with this commit we're leveraging the fact that before every Push, we have the opportunity to look at the intent leaseholder's local clock and update the intent's local timestamp if its txn is found to be
PENDING
(in order to move the intent out of the pusher's uncertainty window, since the intent's txn could not have causally preceded the pusher).If the above sounds good to you, what I don't understand is what would happen if we didn't have this "optimization". I recall from our meeting that you'd alluded to this being more than just an optimization. Without this optimization, a reader might redundantly block on a txn that commits way later and doesn't causally precede the reader, yes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aayushshah15 and I talked about this in person and we're on the same page now. Summarizing the discussion below.
Yes, this is correct.
This is also mostly correct. Without this, a high-priority pusher that pushes the timestamp of another transaction would still see the pushee's intent as uncertain when it returned to read because the intent would retain its local timestamp. It would then ratchet its read timestamp to that of the pushee and end up in the same situation when it attempted to read again. This would continue indefinitely. In effect, this would allow a high-priority reader to block on a lower-priotity writer — a form of priority inversion.