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: close pebble iter gracefully when NewPebbleSSTIterator fails #84003

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

msbutler
Copy link
Collaborator

@msbutler msbutler commented Jul 7, 2022

Currently, if pebble.NewExternalIter sets pebbleIterator.inuse to True, but
then fails, the subsequent pebbleIterator.destroy() will panic unecessarily,
since the caller of pebble.NewExternalIter is not actually using the iter.
This bug causes TestBackupRestoreChecksum to flake in #83984.

To fix, this patch uses pebble.Close() to gracefully close the pebbleIterator
if pebble.NewExternalIter fails.

Release Note: None

Currently, if `pebble.NewExternalIter` sets pebbleIterator.inuse to True, but
then fails, the subsequent `pebbleIterator.destroy()` will panic unecessarily,
since the caller of `pebble.NewExternalIter` is not actually using the iter.
This bug causes TestBackupRestoreChecksum to flake in cockroachdb#83984.

To fix, this patch uses pebble.Close() to  gracefully close the pebbleIterator
if `pebble.NewExternalIter` fails.

Release Note: None
@msbutler msbutler requested a review from erikgrinaker July 7, 2022 14:59
@msbutler msbutler requested a review from a team as a code owner July 7, 2022 14:59
@msbutler msbutler self-assigned this Jul 7, 2022
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

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

Oops, thanks for fixing!

@msbutler
Copy link
Collaborator Author

msbutler commented Jul 7, 2022

bors r=erikgrinaker

@craig
Copy link
Contributor

craig bot commented Jul 7, 2022

Build succeeded:

@craig craig bot merged commit 2dd8e76 into cockroachdb:master Jul 7, 2022
@msbutler msbutler deleted the butler-newPebbleIterator-close branch July 7, 2022 23:51
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