-
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
*: fix system config for tenant #76504
*: fix system config for tenant #76504
Conversation
e0736fe
to
c3bff52
Compare
c3bff52
to
faea93b
Compare
faea93b
to
6efa71d
Compare
This is more or less ready for a look. There are some questions about the mixed version tenant behavior and about the |
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.
This seems pretty close. Should we unskip some of the locality optimized search logic tests that were blocked on #75864 as part of this patch as well?
I still haven't looked at spanconfigcomparedccl
diffs, but publishing comments for everything else.
Reviewed 31 of 33 files at r1, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @adityamaru and @ajwerner)
pkg/config/system.go, line 418 at r1 (raw file):
// configuration. // // TODO(XXX): If the reconciliation protocol is not active, and this is a
We should probably remove the "XXX" and keep this comment around before we merge. Do you think it's worth being a bit verbose and adding some words about how the host changing RANGE TENANTS
fits into this ugliness?
pkg/config/system.go, line 428 at r1 (raw file):
if !codec.ForSystemTenant() && (id == 0 || !version.IsActive( clusterversion.EnsureSpanConfigReconciliation,
nit: In GetConfReader
, we gate on EnableSpanConfigStore
-- should we use that here as well?
pkg/sql/zone_config.go, line 201 at r1 (raw file):
return nil, nil, false, err } if err = completeZoneConfig(zone, keys.SystemSQLCodec, zoneID, getKey); err != nil {
Should this change to codec as well?
pkg/sql/gcjob/refresh_statuses.go, line 344 at r1 (raw file):
tenantTTLSeconds := execCfg.DefaultZoneConfig.GC.TTLSeconds v := execCfg.Settings.Version.ActiveVersionOrEmpty(ctx) zoneCfg, err := cfg.GetZoneConfigForObject(keys.MakeSQLCodec(roachpb.MakeTenantID(tenID)), v, 0)
Should we instead be passing in execCfg.SystemSQLCodec
here instead? Then, we won't have to special case for this 0 value in GetZoneConfigForObject
.
Separately, should we instead be using TenantsRangesID
instead of 0 here? Unless I'm misremembering, a draft version of this used TenantsRangesID
here; has our thinking changed since?
pkg/ccl/kvccl/kvtenantccl/tenant_upgrade_test.go, line 40 at r1 (raw file):
// TestTenantUpgrade exercises the case where a system tenant is in a // non-finalized version state and creates a tenant. The test ensures // that newly created tenant begins in that same version.
nit: "that the"
/Table/106 num_replicas=7 num_voters=5 | ||
/Table/107 num_replicas=7 | ||
/Table/50 database system (host) | ||
/Table/106 ignore_strict_gc=true num_replicas=7 num_voters=5 rangefeed_enabled=true |
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.
Looking only at these tests, what this diff indicates is that according to the system config span, the new two tables have configs with ignore_strict_gc=true rangefeed_enabled=true
. Is that expected? Shouldn't be, right? Since they're not system tables.
6efa71d
to
ff63efc
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.
RFAL
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @adityamaru, @arulajmani, and @irfansharif)
pkg/config/system.go, line 418 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
We should probably remove the "XXX" and keep this comment around before we merge. Do you think it's worth being a bit verbose and adding some words about how the host changing
RANGE TENANTS
fits into this ugliness?
Done.
pkg/config/system.go, line 428 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
nit: In
GetConfReader
, we gate onEnableSpanConfigStore
-- should we use that here as well?
Done.
pkg/sql/zone_config.go, line 201 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Should this change to codec as well?
Done.
pkg/sql/gcjob/refresh_statuses.go, line 344 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Should we instead be passing in
execCfg.SystemSQLCodec
here instead? Then, we won't have to special case for this 0 value inGetZoneConfigForObject
.Separately, should we instead be using
TenantsRangesID
instead of 0 here? Unless I'm misremembering, a draft version of this usedTenantsRangesID
here; has our thinking changed since?
Done.
pkg/ccl/kvccl/kvtenantccl/tenant_upgrade_test.go, line 40 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
nit: "that the"
Done.
pkg/ccl/spanconfigccl/spanconfigcomparedccl/testdata/basic, line 61 at r1 (raw file):
Previously, irfansharif (irfan sharif) wrote…
Looking only at these tests, what this diff indicates is that according to the system config span, the new two tables have configs with
ignore_strict_gc=true rangefeed_enabled=true
. Is that expected? Shouldn't be, right? Since they're not system tables.
I think I fixed it with Arul's help
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 9 of 10 files at r2, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @adityamaru, @ajwerner, @arulajmani, and @irfansharif)
pkg/config/system.go, line 403 at r2 (raw file):
// GetZoneConfigForObject returns the combined zone config for the given object // identifier and SQL codec. Note that id=0 with a secondary tenant codec
Now that you've changed the GC code to use RANGE TENANTS
id, can we get rid of this special casing?
Follow-on from cockroachdb#76279. Fixes cockroachdb#75864. This commit adds a mechanism to combine the system config data of the tenant with the data provided over the GossipSubscription from the system tenant. It then plumbs a version into the zone config methods. In the mixed version state, the tenant uses the existing override from the system tenant. After the span config infrastructure has been activated, the tenant uses the overrides they've set. This affects, realistically, just the GC job, and, to a lesser extent, the optimizer. Release note: None
ff63efc
to
69e48ba
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @adityamaru, @arulajmani, and @irfansharif)
pkg/config/system.go, line 403 at r2 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Now that you've changed the GC code to use
RANGE TENANTS
id, can we get rid of this special casing?
Done.
TFTR! bors r+ |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 69e48ba to blathers/backport-release-22.1-76504: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 22.1.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Follow-on from #76279.
Fixes #75864.
This commit adds a mechanism to combine the system config data of the tenant
with the data provided over the GossipSubscription from the system tenant.
It then plumbs a version into the zone config methods. In the mixed version
state, the tenant uses the existing override from the system tenant. After
the span config infrastructure has been activated, the tenant uses the
overrides they've set. This affects, realistically, just the GC job, and,
to a lesser extent, the optimizer.
Release note: None