cockroachdb / cockroachdb/cockroach
sql/schemachanger: gcjob can delete the descriptors to early
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
When using the DelRange mode of the schema changer GC job, its possible for data to be deleted before the GC interval is hit. This happens because we wait for the prefix to be empty via KV before deleting the descriptor and zone config. This can be easily reproduced by:
```
SET CLUSTER SETTING. sql.gc_job.wait_for_gc.interval='3s'
CREATE DATABASE foo
ALTER DATABASE foo CONFIGURE ZONE USING gc.ttlseconds = 12345
CREATE TABLE foo.public.bar (x INT PRIMARY KEY)
DROP DATABASE foo CASCADE
```
Because the prefix is empty the descriptor for bar will be instantly deleted, which is not ideal.
Jira issue: CRDB-51625
Epic CRDB-61004
Contributor guide
Assessment
This issue has not been assessed yet.