Skip to content

storage: support reading and writing raw engine range keys#83031

Merged
craig[bot] merged 3 commits intocockroachdb:masterfrom
erikgrinaker:mvcc-range-tombstones-engine-iter
Jun 24, 2022
Merged

storage: support reading and writing raw engine range keys#83031
craig[bot] merged 3 commits intocockroachdb:masterfrom
erikgrinaker:mvcc-range-tombstones-engine-iter

Conversation

@erikgrinaker
Copy link
Copy Markdown
Contributor

@erikgrinaker erikgrinaker commented Jun 17, 2022

storage: rename ClearAllMVCCRangeKeys to ClearAllRangeKeys

Since Engine.ExperimentalClearAllMVCCRangeKeys takes only
roachpb.Key bounds, it can be used to clear both MVCC range keys and
more general engine range keys. This patch therefore renames the method
to ExperimentalClearAllRangeKeys to make it agnostic to the range key
type.

Release note: None

storage: support range keys in EngineIterator

This patch adds range key support to EngineIterator. This is needed
e.g. to process range keys in the Raft machinery, which operates on
arbitrary range data.

No tests are included, as there is no existing test framework for
EngineIterator. The logic is a simple wrapper around Pebble, so this
was considered less problematic than it would normally be.

Resolves #82935.

Release note: None

storage: add Engine.ExperimentalPutEngineRangeKey

This patch adds Engine.ExperimentalPutEngineRangeKey to write raw
engine range keys. This will be used e.g. when ingesting Raft snapshots,
which is agnostic to the kind of range key and doesn't care about
decoding or encoding them.

Release note: None

@erikgrinaker erikgrinaker requested a review from a team as a code owner June 17, 2022 11:55
@erikgrinaker erikgrinaker self-assigned this Jun 17, 2022
@erikgrinaker erikgrinaker requested a review from a team as a code owner June 17, 2022 11:55
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@erikgrinaker erikgrinaker force-pushed the mvcc-range-tombstones-engine-iter branch 2 times, most recently from ccd3bda to cb77df3 Compare June 17, 2022 13:14
@erikgrinaker erikgrinaker force-pushed the mvcc-range-tombstones-engine-iter branch from cb77df3 to 5ac358a Compare June 17, 2022 13:39
Since `Engine.ExperimentalClearAllMVCCRangeKeys` takes only
`roachpb.Key` bounds, it can be used to clear both MVCC range keys and
more general engine range keys. This patch therefore renames the method
to `ExperimentalClearAllRangeKeys` to make it agnostic to the range key
type.

Release note: None
This patch adds range key support to `EngineIterator`. This is needed
e.g. to process range keys in the Raft machinery, which operates on
arbitrary range data.

No tests are included, as there is no existing test framework for
`EngineIterator`. The logic is a simple wrapper around Pebble, so this
was considered less problematic than it would normally be.

Release note: None
This patch adds `Engine.ExperimentalPutEngineRangeKey` to write raw
engine range keys. This will be used e.g. when ingesting Raft snapshots,
which is agnostic to the kind of range key and doesn't care about
decoding or encoding them.

Release note: None
@erikgrinaker erikgrinaker force-pushed the mvcc-range-tombstones-engine-iter branch from 5ac358a to fb91e27 Compare June 18, 2022 09:27
Copy link
Copy Markdown
Collaborator

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

Nice. :lgtm:

Reviewed 6 of 6 files at r1, 8 of 8 files at r2, 6 of 6 files at r3, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @itsbilal and @jbowens)

@erikgrinaker
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r=nicktrav

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 24, 2022

Build succeeded:

@craig craig bot merged commit c09d7fc into cockroachdb:master Jun 24, 2022
@erikgrinaker erikgrinaker deleted the mvcc-range-tombstones-engine-iter branch June 24, 2022 10:22
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.

storage: expose range keys in EngineIterator

3 participants