Skip to content
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

storage: set correct key in WriteTooOld error from pebbleMVCCScanner #131220

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

nvanbenschoten
Copy link
Member

Noticed while reviewing #131093.

This commit fixes pebbleMVCCScanner to set the correct key for the mostRecentKey field when a locking read encounters multiple keys with more recent timestamps. These keys were added to WriteTooOldError in 52c6b1b, which had previously only been carrying the maximum conflicting timestamp. They are currently only used for debugging.

Before this fix, we would always return the first conflicting key, even though we correctly returned the maximum conflicting timestamp.

I'm planning to backport this to each release branch to avoid any confusing during debugging odysseys, but could be convinced that doing so is not worth the (minimal) risk.

Epic: None
Release note: None

Noticed while reviewing cockroachdb#131093.

This commit fixes pebbleMVCCScanner to set the correct key for the
mostRecentKey field when a locking read encounters multiple keys with
more recent timestamps. These keys were added to WriteTooOld error in
52c6b1b, which had previously only been carrying the maximum
conflicting timestamp. They are currently only used for debugging.

Before this fix, we would always return the first conflicting key, even
though we correctly returned the maximum conflicting timestamp.

Epic: None
Release note: None
@nvanbenschoten nvanbenschoten added backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1. backport-24.2.x Flags PRs that need to be backported to 24.2 labels Sep 23, 2024
@nvanbenschoten nvanbenschoten requested a review from a team as a code owner September 23, 2024 16:54
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find.

@nvanbenschoten
Copy link
Member Author

TFTR!

bors r+

Copy link

blathers-crl bot commented Sep 25, 2024

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 6a935de to blathers/backport-release-23.1-131220: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.1.x failed. See errors above.


error creating merge commit from 6a935de to blathers/backport-release-23.2-131220: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1. backport-24.2.x Flags PRs that need to be backported to 24.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants