Skip to content

Commit

Permalink
spanconfig: rename setting to `spanconfig.storage_coalesce_adjacent.e…
Browse files Browse the repository at this point in the history
…nabled`

Our terminology is "tenant" vs "storage cluster". The word "host" is
not used anywhere in CockroachDB (it is a term specific to CC
Serverless) and so should not be included in setting names.

There is no release note because the functionality is not yet visible
to end-users.

Release note: None
  • Loading branch information
knz committed Jan 30, 2023
1 parent 69dd453 commit b2d1267
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions pkg/settings/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ var retiredSettings = map[string]struct{}{
"sql.distsql.drain.cancel_after_wait.enabled": {},
"changefeed.active_protected_timestamps.enabled": {},
"jobs.scheduler.single_node_scheduler.enabled": {},
// renamed.
"spanconfig.host_coalesce_adjacent.enabled": {},
}

// sqlDefaultSettings is the list of "grandfathered" existing sql.defaults
Expand Down
22 changes: 11 additions & 11 deletions pkg/spanconfig/spanconfigstore/span_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ import (
"github.com/cockroachdb/errors"
)

// tenantCoalesceAdjacentSetting is a hidden cluster setting that controls
// whether we coalesce adjacent ranges in the tenant keyspace if they have the
// same span config.
// tenantCoalesceAdjacentSetting is a hidden cluster setting that
// controls whether we coalesce adjacent ranges across all secondary
// tenant keyspaces if they have the same span config.
var tenantCoalesceAdjacentSetting = settings.RegisterBoolSetting(
settings.SystemOnly,
"spanconfig.tenant_coalesce_adjacent.enabled",
`collapse adjacent ranges with the same span configs`,
`collapse adjacent ranges with the same span configs across all secondary tenant keyspaces`,
true,
)

// hostCoalesceAdjacentSetting is a hidden cluster setting that controls
// whether we coalesce adjacent ranges in the host tenant keyspace if they have
// the same span config.
var hostCoalesceAdjacentSetting = settings.RegisterBoolSetting(
// storageCoalesceAdjacentSetting is a hidden cluster setting that
// controls whether we coalesce adjacent ranges outside of the
// secondary tenant keyspaces if they have the same span config.
var storageCoalesceAdjacentSetting = settings.RegisterBoolSetting(
settings.SystemOnly,
"spanconfig.host_coalesce_adjacent.enabled",
`collapse adjacent ranges with the same span configs`,
"spanconfig.storage_coalesce_adjacent.enabled",
`collapse adjacent ranges with the same span configs for the ranges specific to the system tenant`,
false,
)

Expand Down Expand Up @@ -152,7 +152,7 @@ func (s *spanConfigStore) computeSplitKey(start, end roachpb.RKey) (roachpb.RKey
// ranges.
systemTableUpperBound := keys.SystemSQLCodec.TablePrefix(keys.MaxReservedDescID + 1)
if roachpb.Key(rem).Compare(systemTableUpperBound) < 0 ||
!hostCoalesceAdjacentSetting.Get(&s.settings.SV) {
!storageCoalesceAdjacentSetting.Get(&s.settings.SV) {
return roachpb.RKey(match.span.Key), nil
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/generate_objects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func BenchmarkGenerateObjects(b *testing.B) {

// Disable auto stats and range splits, which introduce noise.
db.Exec(b, `SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false`)
db.Exec(b, `SET CLUSTER SETTING spanconfig.host_coalesce_adjacent.enabled = true`)
db.Exec(b, `SET CLUSTER SETTING spanconfig.storage_coalesce_adjacent.enabled = true`)

for _, bench := range benches {
b.Run(bench.name, func(b *testing.B) {
Expand Down

0 comments on commit b2d1267

Please sign in to comment.