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: break some dependencies on inconsistent reads with intent interleaving #109794

Conversation

nvanbenschoten
Copy link
Member

Informs #109647.

This commit eliminates a pair of dependencies in mvccPutInternal on inconsistent reads and intent interleaving when a transactional write wanted to read below its own intent. Instead, we can simply read at the timestamp preceding the intent, which is what the pebbleMVCCScanner was doing under the hood anyway.

Release note: None

…terleaving

Informs cockroachdb#109647.

This commit eliminates a pair of dependencies in mvccPutInternal on inconsistent
reads and intent interleaving when a transactional write wanted to read below
its own intent. Instead, we can simply read at the timestamp preceding the
intent, which is what the pebbleMVCCScanner was doing under the hood anyway.

Release note: None
@nvanbenschoten nvanbenschoten requested a review from a team as a code owner August 31, 2023 05:27
@blathers-crl
Copy link

blathers-crl bot commented Aug 31, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

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

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @nvanbenschoten)


pkg/storage/mvcc.go line 1777 at r1 (raw file):

			// value on the key, we read below our previous intents here.
			metaTimestamp := meta.Timestamp.ToTimestamp()
			exVal, _, err = mvccGet(ctx, iter, key, metaTimestamp.Prev(), MVCCGetOptions{

this is still an intentInterleavingIter, yes?

Copy link
Member Author

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

TFTR!

bors r=sumeerbhola

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @sumeerbhola)


pkg/storage/mvcc.go line 1777 at r1 (raw file):

Previously, sumeerbhola wrote…

this is still an intentInterleavingIter, yes?

It is for now, yes, but it no longer needs to be. I have a branch that strips out the intentInterleavingIter from mutation paths and this change was needed to get unit tests passing. That PR will be published some time in the next week.

@craig
Copy link
Contributor

craig bot commented Sep 5, 2023

Build succeeded:

@craig craig bot merged commit 2af50c0 into cockroachdb:master Sep 5, 2023
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/putInternalNoInterleave branch September 5, 2023 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants