-
Notifications
You must be signed in to change notification settings - Fork 4.1k
kv: timetravel queries do not error on ClearRange'd data #31563
Copy link
Copy link
Closed
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-3-erroneous-edge-caseDatabase produces or stores erroneous data without visible error/warning, in rare edge cases.Database produces or stores erroneous data without visible error/warning, in rare edge cases.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Description
Describe the problem
After dropping a table and the underlying data has been deleted by the ClearRange command, queries with a transaction timestamp before the table has been dropped serve empty, invalid results. It should error because by the time ClearRange has been issued, the GC ttl should have already been passed.
This also affects drop index when the index truncation uses ClearRange, where if a transaction uses an older version of a table descriptor with the index then incorrect results are returned if the index is used.
To Reproduce
create table t(i int primary key);- insert some data into
t - note timestamp from
select now(); - (optionally)
alter table t configure zone with gc.ttlseconds={ttlseconds} drop table t- wait GC period until the
dropjob has completed select * from t as of system time '{timestamp from 3}'
Jira issue: CRDB-4786
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-3-erroneous-edge-caseDatabase produces or stores erroneous data without visible error/warning, in rare edge cases.Database produces or stores erroneous data without visible error/warning, in rare edge cases.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)