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

db: remove handling of untruncated range tombstones #3245

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

jbowens
Copy link
Collaborator

@jbowens jbowens commented Jan 25, 2024

For a couple years now, Pebble has not allowed the creation of untruncated range tombstones outside the context of virtual sstables. Additionally, since v22.2 untruncated range tombstones should all have been compacted and rewritten as truncated range tombstones. Virtual SSTables (which similarly allow a physical range deletion to exceed the bounds of the containing logical sstable) handle this case by truncating the tombstones at iteration time in the iterator returned by keyspan.Truncate.

This leaves the merging iterator's delicate handling of untruncated range tombstones obsolete. This commit removes that complexity. In addition, as an extra safety precaution, the table stats collector's invariants-build assertion that range deletions are contained within their files' bounds is lifted into production builds as well. This provides a guarantee during store open that all tombstones are appropriately truncated.

Relates to #2863.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jbowens jbowens requested review from RaduBerinde, sumeerbhola and a team January 25, 2024 22:38
@nicktrav
Copy link
Contributor

Love it!

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm:

Great! I knew this needed cleanup but I was.. very.. afraid

Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @sumeerbhola)

@jbowens jbowens force-pushed the untruncated-rangedels branch from cbbebad to 902f0ac Compare January 26, 2024 15:00
For a couple years now, Pebble has not allowed the creation of untruncated
range tombstones outside the context of virtual sstables. Additionally, since
v22.2 untruncated range tombstones should all have been compacted and rewritten
as truncated range tombstones. Virtual SSTables (which similarly allow a
physical range deletion to exceed the bounds of the containing logical sstable)
handle this case by truncating the tombstones at iteration time in the iterator
returned by keyspan.Truncate.

This leaves the merging iterator's delicate handling of untruncated range
tombstones obsolete. This commit removes that complexity. In addition, as an
extra safety precaution, the table stats collector's invariants-build assertion
that range deletions are contained within their files' bounds is lifted into
production builds as well. This provides a guarantee during store open that all
tombstones are appropriately truncated.

Relates to cockroachdb#2863.
@jbowens jbowens force-pushed the untruncated-rangedels branch from 902f0ac to fc46779 Compare January 26, 2024 15:32
Copy link
Collaborator Author

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

TFTR!

Reviewable status: 0 of 5 files reviewed, all discussions resolved (waiting on @sumeerbhola)

@jbowens jbowens merged commit eb8e9db into cockroachdb:master Jan 29, 2024
11 checks passed
@jbowens jbowens deleted the untruncated-rangedels branch January 29, 2024 16:31
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.

4 participants