model-writtenrun 6207 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
May - Aug 2021 ยท 15 entries
- Pengchengliu reported a PostgreSQL 13.2 parallel-worker assertion failure when subtransaction snapshots overflowed, tracing it to a worker TransactionXmin newer than the snapshot used for scanning, and supplied reproduction scripts in #1 and #4.
- After initially struggling to reproduce the failure, Greg Nancarrow argued that snapshot initialization rather than the assertion was wrong and proposed using the active snapshot in #14; Zhijie Hou reproduced the crash and reported that this inline change survived two hours of testing in #18.
- Greg Nancarrow submitted PostgreSQL 13.2 and 14 patches that passed only the active snapshot to workers and installed it as both transaction and active snapshot, reporting successful regression tests in #21, then resent the PostgreSQL 14 variant for cfbot in #22.
- Pavel Borisov supplied a more reliable reproducer and reported that the patch prevented crashes in #25, which also enabled Greg Nancarrow to reproduce the original failure and confirm the fix in #26.
- Maxim Orlov demonstrated that increasing the subtransaction cache avoided the triggering overflow in #27, but Pavel Borisov explained that this was diagnostic evidence rather than a proper fix because overflow itself is legitimate in #29.
- Maxim Orlov proposed replacing the queried XID with TransactionXmin in parallel workers in #31; Greg Nancarrow rejected this as masking the underlying snapshot problem in #32, and Tomas Vondra identified additional wraparound and visibility problems in #35.
- Following concerns from Pavel Borisov and Tomas Vondra about retaining both snapshots, Maxim Orlov moved the adjustment into worker initialization to use the smaller xmin in #36, and Pavel reported successful testing in #37.
- Robert Haas explained that GetTransactionSnapshot() takes a new snapshot at lower isolation levels but retrieves durable transaction state at higher levels, rejecting the XID-adjustment approaches and identifying missing REPEATABLE READ and SERIALIZABLE handling in Greg's proposal in #39.
- Greg Nancarrow reinstated his original snapshot fix in #40, and Pavel Borisov reported successful testing across isolation levels in #41, but Robert Haas insisted on preserving the actual transaction snapshot at higher isolation levels before committing in #42.
- Greg Nancarrow implemented Robert Haas's proposal to omit transaction-snapshot restoration at lower isolation levels in #43, but it failed check-world; Pavel Borisov added a first-snapshot condition in #44, after which both Greg and Pavel still reproduced the original crash in #46 and #47.
- Greg Nancarrow reinstated the original approach on an updated base in #51, while Robert Haas continued to explain why active and transaction snapshots must remain independently reproducible at higher isolation levels in #52.
- Greg Nancarrow identified the missing initialization side effect: skipping RestoreTransactionSnapshot() allowed TransactionXmin to advance beyond the query's snapshot in #55, and Robert Haas agreed that installing the active snapshot was necessary at lower isolation levels while retaining the real transaction snapshot at higher levels in #56.
- Greg Nancarrow implemented that combined approach and reported successful crash testing across isolation levels in #57; serialization errors seen during SERIALIZABLE tests also occurred without the patch.
- Robert Haas requested removal of the new snapshot helper and a comment explaining the TransactionXmin invariant in #58, then suggested storing restored snapshots in local variables to share the restoration calls in #60, which Greg incorporated in #61.
- Robert Haas committed the exact source changes from #61 as a780b2fcce and announced backpatches through PostgreSQL 10 in #62, closing the fix; PostgreSQL 9.6 was left unpatched because exposure required third-party parallel-context code and its shm_toc_lookup() lacked the needed optional-lookup argument.