fix: expire must not drop live rows or leave them visible to index-only scans - #869
fix: expire must not drop live rows or leave them visible to index-only scans#869OffgridwithJD wants to merge 1 commit into
Conversation
…only scans Co-authored-by: Cursor <cursoragent@cursor.com>
Premise verified — this is silent data loss, and worse than the summary saysMeasured on pg18a. One row group holding 900 rows whose timestamps are all 400 On main,
A NULL retention is not "expired"; it is "unknown". Deleting it errs the other The fix is not vacuous — control runA guard that returns early can pass a keep-the-rows test by never expiring So a fully-expired group with no NULLs is still retired. That is your unchecked
|
Summary
pgcolumnar.expiredecided a row group was fully past retention from the zone-map maximum alone. That maximum ignores NULLs, so a group of expired timestamps plus NULL retention values was retired and the NULL rows disappeared.Test plan
test/ttl_expire.shon PostgreSQL 18 incusor-2604(NULL retention rows kept; index-only scan returns 0 after expire)Made with Cursor