Skip to content

storage: don't return WriteTooOld on inline DeleteRange that hits non-inline value#101445

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/fix101440
Apr 14, 2023
Merged

storage: don't return WriteTooOld on inline DeleteRange that hits non-inline value#101445
craig[bot] merged 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/fix101440

Conversation

@nvb
Copy link
Copy Markdown
Contributor

@nvb nvb commented Apr 13, 2023

Fixes #101440.

This commit resolves a condition where an inline DeleteRange request could return a WriteTooOld error when encountering a non-inline value, instead of returning the expected assertion error. This could trigger a fatal error in tryBumpBatchTimestamp. See the corresponding issue for more details.

Note that this is not resolving any condition that could cause an inline DeleteRange request to hit a non-inline value, it's just ensuring that if corruption creates such a condition, we don't fatal.

Release note: None

@nvb nvb requested a review from kvoli April 13, 2023 14:35
@nvb nvb requested a review from a team as a code owner April 13, 2023 14:35
@nvb nvb requested a review from jbowens April 13, 2023 14:35
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@kvoli kvoli left a comment

Choose a reason for hiding this comment

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

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


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

	// versions, so we want to pass these incompatible keys to mvccPutInternal to
	// detect the condition and return an error. We also scan with the
	// FailOnMoreRecent set to true. This is not strictly necessary (nothing is

Isn't the MaxTimeStamp only being set below when failOnMoreRecent = false? I got a bit lost on this part of the comment.

Code quote:

	// detect the condition and return an error. We also scan with the
	// FailOnMoreRecent set to true. This is not strictly necessary (nothing is
	// more recent than MaxTimestamp), but it provides added protection against
	// the scan returning a WriteTooOld error.

…-inline value

Fixes cockroachdb#101440.

This commit resolves a condition where an inline DeleteRange request
could return a WriteTooOld error when encountering a non-inline value,
instead of returning the expected assertion error. This could trigger a
fatal error in `tryBumpBatchTimestamp`. See the corresponding issue for
more details.

Note that this is not resolving any condition that could cause an inline
DeleteRange request to hit a non-inline value, it's just ensuring that
if corruption creates such a condition, we don't fatal.

Release note: None
@nvb nvb force-pushed the nvanbenschoten/fix101440 branch from 4732cc6 to ba670ba Compare April 13, 2023 21:44
Copy link
Copy Markdown
Contributor Author

@nvb nvb left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jbowens and @kvoli)


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

Previously, kvoli (Austen) wrote…

Isn't the MaxTimeStamp only being set below when failOnMoreRecent = false? I got a bit lost on this part of the comment.

Nice catch. This was meant to say "FailOnMoreRecent set to false". Done.

Copy link
Copy Markdown
Contributor

@kvoli kvoli 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 r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jbowens)

@nvb
Copy link
Copy Markdown
Contributor Author

nvb commented Apr 14, 2023

bors r=kvoli

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 14, 2023

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

storage: don't fatal on inline DeleteRange that hits non-inline value

4 participants