Skip to content

sql,config: tenant zone config lookup is broken #75864

@ajwerner

Description

@ajwerner

Describe the problem

In #74612 we made it so that the tenant has access to its own zone configs via the SystemConfig object provided by the systemconfigwatcher. Unfortunately this did not go far enough to actually fully address #70558 because of this special case logic:

func (s *SystemConfig) GetZoneConfigForObject(
codec keys.SQLCodec, id uint32,
) (*zonepb.ZoneConfig, error) {
var sysID SystemTenantObjectID
if codec.ForSystemTenant() {
sysID = SystemTenantObjectID(id)
} else {
sysID = keys.TenantsRangesID
}
entry, err := s.getZoneEntry(sysID)
if err != nil {
return nil, err
}
return entry.combined, nil
}

Solution

We need to either remove the above logic or make it conditional on where the config is coming from and more generally make sure that the SystemConfig methods work for the tenant.

Epic: CRDB-10489

Jira issue: CRDB-12864

Metadata

Metadata

Assignees

Labels

A-zone-configsC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.GA-blockerT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)branch-masterFailures and bugs on the master branch.branch-release-22.1Used to mark GA and release blockers, technical advisories, and bugs for 22.1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions