Skip to content

ttljob: when a range intersects two tables, the job fails #81208

@otan

Description

@otan

Consider the following setup:

CREATE TABLE tbl (
	id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
	text TEXT
) WITH (ttl_expire_after = '30 days');
ALTER TABLE tbl SPLIT AT VALUES (gen_random_uuid());
CREATE TABLE tbl2 (id INT PRIMARY KEY);
ALTER TABLE tbl2 SPLIT AT VALUES (1);

In this case, there may be a range that is valid between /tbl1/gen_random_uuid() and /tbl2/1. If this is the case, a TTL job may fail with a error decoding X bytes message. The impact here is that TTL does not succeed and rows do not get cleaned up (foreground traffic still occurs).

In practice, this would only happen if:

  • the table is sufficiently large.
  • there are multiple tables in the database
  • usually only the last range on the table is affected - other rows are TTL'd

Jira issue: CRDB-15299

Metadata

Metadata

Assignees

Labels

A-row-level-ttlC-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-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