Repository navigation
Description
Observed behavior
While investigating the Ubuntu UT failure in #29535, a PICK transaction updated one SNAPSHOT registry row, then updated two rows after a registry flush and failed its uniqueness guard.
Root cause and scope
A lifecycle UPDATE, including a no-op UPDATE, deletes the old Rowid and inserts its replacement. TN flush/merge can relocate the committed row. Advancing only TxnOperator.UpdateSnapshot bypasses the workspace RC tombstone transfer: the old tombstone no longer hides the relocated row, so the transaction sees both that row and its own replacement.
Restoring only the old timestamp with SetSnapshotTS after tombstone transfer also leaves the workspace and snapshot inconsistent and can resurrect deletes.
The affected lineage snapshot paths include COPY ALTER, TRUNCATE, internal PITR, CLONE and snapshot creation. This is independent of the IVF changes in #29535.
Controlled reproduction
- Commit rows with distinct primary keys.
- In an RC transaction, delete committed rows and insert replacements using the same keys.
- Force TN flush/merge to relocate committed rows.
- Advance using raw
TxnOperator.UpdateSnapshot, bypassing workspace transfer. - Read the exact keys and row count in that transaction.
Expected: each primary key appears once and transaction deletes remain effective.
PR #29539 records an isolated old-behavior mutation of its deterministic regression: expected 10 rows, actual 20, for both in-memory and persisted tombstones. Its original-behavior probes also reproduce resurrection after timestamp-only rewind. These are recorded implementation validation results, not newly rerun during this issue's creation. A public SQL one-liner cannot guarantee the required flush timing.
Proposed fix and verification
Reuse Workspace.AdvanceSnapshot, which already owns RC tombstone relocation; remove timestamp-only rewind after transfer. Preserve the existing physical historical boundary and publication write barrier, without introducing another transfer path or state machine.
Implementation: #29539.
Regression: TestRCLineageSnapshotPreservesUniqueReplacements, using the existing forced-flush harness, covers both tombstone modes, exact key sets, repeated advances and rollback. Existing PICK and statement rollback tests provide integration coverage. The PR records owning-package race validation and public SQL checks; partial transfer I/O failure injection and scale benchmarking remain outside that evidence.
Activity
fix: preserve tombstones across lineage snapshot advances (#29539)
[4.2-dev] fix: preserve tombstones across lineage snapshot advances (#…