-
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
kvserver: emit MVCC range tombstones over rangefeeds #76443
kvserver: emit MVCC range tombstones over rangefeeds #76443
Conversation
// TODO(yevgeniy): Handle SSTs. | ||
// TODO(erikgrinaker): Handle DeleteRange events (MVCC range tombstones). |
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.
@miretskiy @dt Do we need to address these TODOs before stability in order to test streaming replication with 22.1? That is, add handling for AddSSTable
and MVCC range tombstones in streaming replication.
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.
We decided that we will test what we can -- even if some of those ops are not ready yet.
So, these TODOs are fine for now.
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.
Ok. We have pending PRs/issues for the necessary APIs to ingest these on the target cluster, and plan to get these in for 22.1 in experimental form. We'll be maturing these APIs during stability and the 22.1 cycle. So if we get the streaming ingestion code in place before stability as well (i.e. simply make the appropriate API calls) then we should be able to do full end-to-end testing of streaming replication sometime during the 22.1 cycle.
38019ab
to
afe3afb
Compare
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.
few nits questions mostly. I'm sure other reviewers will have more comments.
// TODO(yevgeniy): Handle SSTs. | ||
// TODO(erikgrinaker): Handle DeleteRange events (MVCC range tombstones). |
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.
We decided that we will test what we can -- even if some of those ops are not ready yet.
So, these TODOs are fine for now.
d6106c7
to
edb3d8c
Compare
edb3d8c
to
a36e2fd
Compare
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.
LGTM
438be2a
to
583af44
Compare
This patch falls back to `IterKeyTypePointsOnly` if the Pebble database is not at `FormatRangeKeys` yet, to avoid a Pebble panic. These databases can't contain range keys by definition, so this has no practical effect. Release note: None
This patch adds MVCC range tombstone support to range feeds. Whenever an MVCC range tombstone is written, e.g. a `DeleteRange` request with `UseExperimentalRangeTombstone`, a new `MVCCDeleteRangeOp` logical op type is recorded and emitted across the range feed as an `RangeFeedDeleteRange` event. MVCC range tombstones are under active development, and highly experimental. They will only be used (and emitted) after checking `storage.CanUseExperimentalMVCCRangeTombstones`, which requires a version gate and environment variable to be enabled. Changefeeds will emit an error for these events. We do not expect to see these in online spans with changefeeds, since they are initially only planned for use with schema GC and import rollbacks. The rangefeed client library has been extended with support for these events, but no existing callers handle them for the same reason as changefeeds. Initial scans do not emit regular tombstones, and thus not range tombstones either, but catchup scans will emit them if encountered. This only has rudimentary integration testing, as MVCC range tombstones are still experimental and lack e.g. persistence and replication -- more comprehensive tests will be implemented later. Release note: None
583af44
to
68f91c1
Compare
Closing in favor of #82718. |
storage: disable range keys in iterators when unsupported
This patch falls back to
IterKeyTypePointsOnly
if the Pebble databaseis not at
FormatRangeKeys
yet, to avoid a Pebble panic. Thesedatabases can't contain range keys by definition, so this has no
practical effect.
Release note: None
kvserver: emit MVCC range tombstones over rangefeeds
This patch adds MVCC range tombstone support to range feeds. Whenever a
DeleteRange
request withUseExperimentalRangeTombstone
succeeds, a newMVCCDeleteRangeOp
logical op type is recorded and emitted across therange feed as an
RangeFeedDeleteRange
event.MVCC range tombstones are under active development, and highly
experimental. They will only be used (and emitted) after checking
storage.CanUseExperimentalMVCCRangeTombstones
, which requires aversion gate and environment variable to be enabled.
Changefeeds will emit an error for these events. We do not expect to see
these in online spans with changefeeds, since they are initially only
planned for use with schema GC and import rollbacks.
The rangefeed client library has been extended with support for these
events, but no existing callers handle them for the same reason as
changefeeds. Initial scans do not emit regular tombstones, and thus not
range tombstones either, but catchup scans will emit them if
encountered.
This only has rudimentary integration testing, as MVCC range tombstones
are still experimental and lack e.g. persistence and replication -- more
comprehensive tests will be implemented later.
Resolves #70433.
Release note: None