I spent a while trying to debug a failure of alter_table-randomized-test and found the following interesting logs:
- We have two operations in the WAL which arrived in short succession (about 4ms apart) just before an alter table. I've renumbered the txids for readability here:
- and the Flush that was caused by the Altertable has the following snapshots:
Note that the first snapshot considers the 'DELETE' committed but not the 'UPDATE'. We then fill in the 'UPDATE' in the second snapshot.The end result here is that we end up flushing REDO deltas as follows:
REDO file 1 (flushed in phase 1): includes only the DELETE
REDO file 2 (flushed after ReupdateMissedDeltas); includes only the UPDATE
When we later proceed to compact this rowset, we get "Check failed: !is_deleted Got UPDATE for deleted row."
Scenarios like this seem to reproduce a few tenths of a percent of the time in this stress test.