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: add noop behavior for bounds setting in pebbleIterator #61194

Merged
merged 1 commit into from
Mar 1, 2021

Conversation

sumeerbhola
Copy link
Collaborator

This is to compensate for the bug fix in Pebble which removes
the noop behavior from Pebble
cockroachdb/pebble#1073

Added a test that checks that the noop behavior is working,
the contract regarding slice stability is followed, and that
the bounds are correct.

Additionally, there are some minor tweaks involving removal
and addition of some defensive code. The additions are
related to the pebbleIterator.reusable field.

Release justification: Fix for high-severity bug in existing
functionality. The Pebble bug fix that needs to be compensated
here could lead to incorrect results from iterators, even prior
to the latest seek optimization in Pebble (though our existing
tests were not failing prior to that latest seek optimization).

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@jbowens jbowens 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 3 of 4 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @itsbilal, @nvanbenschoten, @petermattis, and @sumeerbhola)


pkg/storage/pebble_iterator.go, line 197 at r1 (raw file):

			}
		}
		if !boundsChanged && upperBound != nil {

if upperBound != nil {

This is to compensate for the bug fix in Pebble which removes
the noop behavior from Pebble
cockroachdb/pebble#1073

Added a test that checks that the noop behavior is working,
the contract regarding slice stability is followed, and that
the bounds are correct.

Additionally, there are some minor tweaks involving removal
and addition of some defensive code. The additions are
related to the pebbleIterator.reusable field.

Release justification: Fix for high-severity bug in existing
functionality. The Pebble bug fix that needs to be compensated
here could lead to incorrect results from iterators, even prior
to the latest seek optimization in Pebble (though our existing
tests were not failing prior to that latest seek optimization).

Release note: None
Copy link
Collaborator Author

@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.

TFTR!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @itsbilal, @jbowens, @nvanbenschoten, and @petermattis)


pkg/storage/pebble_iterator.go, line 197 at r1 (raw file):

Previously, jbowens (Jackson Owens) wrote…

if upperBound != nil {

The lower bound may have changed, which means we don't need to look at the upper bound. I've added a code comment.

@sumeerbhola
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 1, 2021

Build succeeded:

@craig craig bot merged commit 09514e9 into cockroachdb:master Mar 1, 2021
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