-
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
sql,clusterversion,gc_job: hoist version gates for DelRange to 23.1 #98228
sql,clusterversion,gc_job: hoist version gates for DelRange to 23.1 #98228
Conversation
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 12 of 12 files at r1, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker)
pkg/sql/gcjob/gc_job.go
Outdated
s.Version.IsActive(ctx, clusterversion.V23_1_UseDelRangeInGCJob) && | ||
(storage.CanUseMVCCRangeTombstones(ctx, s) || |
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.
Shouldn't some of these predicates be somewhat different now? In mixed-version 22.2/23.1 clusters we should respect the storage.mvcc.range_tombstones.enabled
setting until the V23_1_MVCCRangeTombstonesUnconditionallyEnabled
version gate is enabled, at which point we should unconditionally use them. CanUseMVCCRangeTombstones()
already encapsulates that logic.
The logic here will fail to respect storage.mvcc.range_tombstones.enabled
in mixed-version 22.2/23.1 clusters.
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.
You're correct, it's done.
@@ -508,7 +508,7 @@ func shouldUseDelRange( | |||
) bool { | |||
// TODO(ajwerner): Adopt the DeleteRange protocol for tenant GC. |
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.
Apropos: will the fact that we don't use DeleteRange
here cause problems for C2C streaming? Do we only replicate individual tenants? Do we simply cut off the stream when the tenant is destroyed, or otherwise remove it from the target out-of-band?
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.
@stevendanna can you answer this question?
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.
Do we only replicate individual tenants
Yes, we only replicate individual tenants.
Do we simply cut off the stream when the tenant is destroyed, or otherwise remove it from the target out-of-band?
If the tenant is dropped on the destination side, we stop the job. If the source side is dropped, I have a feeling we likely just keep going. However, an active replication job keeps protected timestamps alive on both the source and destination side. I believe the clear-range based protocol should wait out those protected timestamps before dropping the clears so it should be "OK" from that perspective. We may want a DROP on the source side to kill the producer side streaming job that owns that protected timestamp to prevent holding up GC for too long. But I'm not sure that is essential.
e0ed735
to
e8690f3
Compare
@erikgrinaker PTAL |
e8690f3
to
68d4daf
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, thanks!
We added version gates to unconditionally enable sending DelRange tombstones in 22.2, but then we pre-empted that by disabling them with a cluster setting. This PR hoists those gates and that invariant checking up to 23.1. Relates to cockroachdb#96763 Release note: None
68d4daf
to
05773b6
Compare
bors r+ |
Build failed (retrying...): |
Build succeeded: |
We added version gates to unconditionally enable sending DelRange tombstones in 22.2, but then we pre-empted that by disabling them with a cluster setting. This PR hoists those gates and that invariant checking up to 23.1.
Relates to #96763
Epic: None
Release note: None