Skip to content

gcjob: teach the GC job to respect protected timestamps on tables/indexes #77156

@adityamaru

Description

@adityamaru

The GC job currently relies on the protectedts.Cache to check if there are any protected timestamp records covering a span before allowing GC on the span. In the new protectedts multi-tenant subsystem, protected timestamp records no longer protect spans, but instead protect ptpb.Targets (table, database, tenant, cluster). This issue tracks the changes needed to fix this:

For system tenants:

To continue to work in a mixed version setting, GC jobs on the system tenant should continue to consult both the protectedts.Cache (for older span backed PTS records) and the new ProtectedTimestampStateReader that exports methods to check if a particular Target is protected.

For secondary tenants:

Secondary tenants have never written span-backed PTS records in older versions, and so they only need to consult the ProtectedTimestampStateReader to check if the table or index being gc'ed has a PTS record covering it.

Jira issue: CRDB-13439

Metadata

Metadata

Assignees

Labels

A-kvAnything in KV that doesn't belong in a more specific category.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)branch-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