-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: support MVCC range tombstones in MVCCExportToSST
#82873
storage: support MVCC range tombstones in MVCCExportToSST
#82873
Conversation
73e464f
to
364ef7d
Compare
This should be ready for review now. Sorry about having to drag in #82799. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 6 files at r1, 2 of 8 files at r2, 3 of 6 files at r3, 1 of 1 files at r4, 10 of 11 files at r5, 4 of 4 files at r6, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @aliher1911, @dt, and @erikgrinaker)
pkg/storage/mvcc.go
line 4280 at r6 (raw file):
// doesn't end up being any further point keys covered by it and we go on to // flush them as-is at their normal end key. We need to make sure we have // enough MaxSize budget to flush then in all of these cases.
nit: them* ?
pkg/storage/testdata/mvcc_histories/export
line 3 at r6 (raw file):
# Tests MVCC export. # # Sets up the following dataset, where x is tombstone, o-o is range tombstone, [] is intent.
nit: MVCC range tombstone* just to make it clear this isn't a Pebble range tombstone.
This patch adds support for exporting MVCC range tombstones in `MVCCExportToSST()`, and by extension in the KV `Export` method. This will only happen after two version gates are enabled: * `EnablePebbleFormatVersionRangeKeys`: begins emitting SSTs in `Pebblev2` format, which supports Pebble range keys. * `MVCCRangeTombstones`: allows writing MVCC range tombstones via KV. MVCC range tombstones are emitted in the same way as point tombstones: all tombstones if `ExportAllRevisions` is enabled, or the latest visible tombstone if `StartTS` is given. MVCC range tombstones are truncated to the SST bounds. For example, if exporting the span `a-f` then any range tombstones wider than the span will be truncated to `[a-f)`. If the export hits a limit e.g. at `c` then any MVCC range tombstones in the returned SST are truncated to `[a-c)`. If `StopMidKey` is enabled, then it's possible for two subsequent exports to contain overlapping MVCC range tombstones. For example, given the range tombstone `[a-f)@5`, if we return a resume key at `c@3` then the response will contain a truncated MVCC range tombstone `[a-c\0)@5` which covers the point keys at `c`, but resuming from `c@3` will contain the MVCC range tombstone `[c-f)@5` which overlaps with the MVCC range tombstone in the previous response for the interval `[c-c\0)@5`. `AddSSTable` will allow this overlap during ingestion once it supports MVCC range tombstones. Release note: None
364ef7d
to
a1ecb11
Compare
This comes with a moderate performance penalty, which is mostly due to enabling range keys in Pebble and
TFTR! bors r=itsbilal |
bors r=itsbilal |
Build succeeded: |
This patch adds support for exporting MVCC range tombstones in
MVCCExportToSST()
, and by extension in the KVExport
method.This will only happen after two version gates are enabled:
EnablePebbleFormatVersionRangeKeys
: begins emitting SSTs inPebblev2
format, which supports Pebble range keys.MVCCRangeTombstones
: allows writing MVCC range tombstones via KV.MVCC range tombstones are emitted in the same way as point tombstones:
all tombstones if
ExportAllRevisions
is enabled, or the latest visibletombstone if
StartTS
is given.MVCC range tombstones are truncated to the SST bounds. For example, if
exporting the span
a-f
then any range tombstones wider than the spanwill be truncated to
[a-f)
. If the export hits a limit e.g. atc
then any MVCC range tombstones in the returned SST are truncated to
[a-c)
.If
StopMidKey
is enabled, then it's possible for two subsequentexports to contain overlapping MVCC range tombstones. For example, given
the range tombstone
[a-f)@5
, if we return a resume key atc@3
thenthe response will contain a truncated MVCC range tombstone
[a-c\0)@5
which covers the point keys at
c
, but resuming fromc@3
will containthe MVCC range tombstone
[c-f)@5
which overlaps with the MVCC rangetombstone in the previous response for the interval
[c-c\0)@5
.AddSSTable
will allow this overlap during ingestion once it supportsMVCC range tombstones.
Resolves #71398.
Release note: None