-
Notifications
You must be signed in to change notification settings - Fork 4.1k
gcjob: teach the GC job to respect protected timestamps on tables/indexes #77156
Description
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