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

sql,clusterversion,gc_job: hoist version gates for DelRange to 23.1 #98228

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

ajwerner
Copy link
Contributor

@ajwerner ajwerner commented Mar 8, 2023

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

@ajwerner ajwerner requested review from a team and erikgrinaker March 8, 2023 17:04
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@fqazi fqazi left a 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: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker)

Comment on lines 511 to 510
s.Version.IsActive(ctx, clusterversion.V23_1_UseDelRangeInGCJob) &&
(storage.CanUseMVCCRangeTombstones(ctx, s) ||
Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Collaborator

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.

@ajwerner ajwerner force-pushed the ajwerner/hoist-del-range-gates branch from e0ed735 to e8690f3 Compare March 15, 2023 14:42
@ajwerner
Copy link
Contributor Author

@erikgrinaker PTAL

@ajwerner ajwerner force-pushed the ajwerner/hoist-del-range-gates branch from e8690f3 to 68d4daf Compare March 15, 2023 16:24
@ajwerner ajwerner requested a review from a team as a code owner March 15, 2023 16:24
Copy link
Contributor

@erikgrinaker erikgrinaker left a 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
@ajwerner ajwerner force-pushed the ajwerner/hoist-del-range-gates branch from 68d4daf to 05773b6 Compare March 15, 2023 17:27
@ajwerner
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 15, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Mar 15, 2023

Build succeeded:

@craig craig bot merged commit bb2fe25 into cockroachdb:master Mar 15, 2023
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.

5 participants