Skip to content

spanconfig: cleanup system span configs that apply to a tenant when GC-ing it #76931

@arulajmani

Description

@arulajmani

Describe the problem

Currently, when we GC a tenant, we remove all span configurations that the tenant has installed in KV here:

cockroach/pkg/sql/tenant.go

Lines 472 to 483 in e81c2e7

records, err := scKVAccessor.GetSpanConfigRecords(
ctx, []spanconfig.Target{spanconfig.MakeTargetFromSpan(tenantSpan)},
)
if err != nil {
return err
}
toDelete := make([]spanconfig.Target, len(records))
for i, record := range records {
toDelete[i] = record.Target
}
return scKVAccessor.UpdateSpanConfigRecords(ctx, toDelete, nil /* toUpsert */)

This doesn't account for system span configurations that the tenant has installed on its entire keyspace or the host tenant has installed on the tenant's keyspace. We should be cleaning these up as well when we GC the tenant.

Jira issue: CRDB-13331

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-kvKV Teambranch-masterFailures and bugs on the master branch.release-blockerIndicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions