You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
155837: sql/inspect: fix AS OF SYSTEM TIME span bounds in index checks r=spilchen a=spilchen
INSPECT's index consistency checks could miss spans when using AS OF SYSTEM TIME if those spans had no data at the current time but did at the historical timestamp. This was due to SpanToQueryBounds() using the current time for KV scans instead of the historical time.
This commit:
- Adds an asOf parameter to SpanToQueryBounds() for historical scans
- Updates INSPECT to pass the query's timestamp
- Keeps existing behavior for TTL and tests by passing an empty timestamp
The issue was uncovered while converting TestScrubIndexMissingIndexEntry to INSPECT. The test is now TestMissingIndexEntryWithHistoricalQuery and validates correctness of historical scans.
Informs: #155485
Epic: CRDB-55075
Release note (bug fix): INSPECT now correctly checks index consistency at the historical timestamp when using AS OF SYSTEM TIME, even for spans with no current data.
Co-authored-by: Matt Spilchen <matt.spilchen@cockroachlabs.com>
0 commit comments