Skip to content

db: return error from Close if open snapshots remain#1994

Merged
jbowens merged 1 commit intocockroachdb:masterfrom
jbowens:snapshots-close
Oct 5, 2022
Merged

db: return error from Close if open snapshots remain#1994
jbowens merged 1 commit intocockroachdb:masterfrom
jbowens:snapshots-close

Conversation

@jbowens
Copy link
Copy Markdown
Contributor

@jbowens jbowens commented Oct 4, 2022

Return an error from DB.Close if the database has open snapshots. This helps ensure clients don't accidentally leak snapshots, which during normal operation prevents dropping any keys older than the snapshot.

Fix #1986.

@jbowens jbowens requested a review from a team October 4, 2022 21:28
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@jbowens jbowens requested a review from erikgrinaker October 4, 2022 21:28
Copy link
Copy Markdown
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.

Thanks!

Copy link
Copy Markdown
Contributor

@nicktrav nicktrav 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 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jbowens)

Return an error from DB.Close if the database has open snapshots. This
helps ensure clients don't accidentally leak snapshots, which during
normal operation prevents dropping any keys older than the snapshot.

Fix cockroachdb#1986.
@jbowens
Copy link
Copy Markdown
Contributor Author

jbowens commented Oct 5, 2022

tftrs!

@jbowens jbowens merged commit eec7375 into cockroachdb:master Oct 5, 2022
@jbowens jbowens deleted the snapshots-close branch October 5, 2022 18:57
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.

DB.Close() should error on leaked snapshots

4 participants