model-writtenrun 8923 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Justin Pryzby reported a PostgreSQL 12.1 checkpointer panic after a table-rewriting ALTER TABLE, and Thomas Munro began investigating why a missing relation segment had no apparent cancellation request #1 #2.
- Justin found that an earlier segment remained open and reported another crash during index maintenance, strengthening the connection to multisegment relations #7 #9.
- Thomas reproduced the failure with tiny segments and explained that _mdfd_getseg() opens preceding segments, which may already have been deleted when cancellation requests arrive in separate batches; he considered reversing deletion order, cancelling all segments first, or restoring relation-wide cancellation #10.
- Thomas's first patch discovered all segments and sent their cancellation requests before deleting them, and Justin confirmed that it also fixed his independent reproducer #11 #12.
- Thomas identified remaining problems if filesystem errors interrupted segment discovery, then posted an alternative that opened only the requested segment for synchronization instead of changing deletion order #13 #14.
- Thomas refined the alternative to reuse an already-open descriptor when available and otherwise use a transient descriptor #15; this version landed with only declaration-style and wording edits as 7bb3102cea, with a backport to PostgreSQL 12, and he announced the push #16.
- The build farm exposed a low-file-descriptor-limit failure because FileGetRawDesc() did not call FileAccess(); Thomas reported rewriting the fix to use only File handles and testing it with the earlier reproducer under ulimit -n 50 #17 #18 #19.
- Five years later, Andres Freund observed that the synchronization change had removed the last use of EXTENSION_DONT_CHECK_SIZE and proposed deleting the unsafe, obsolete mode; Thomas agreed #20 #21.
- Thomas removed the unused flag and associated checks and comments in 48c142f78d and announced completion in the final message, leaving no outstanding patch proposal in the thread #22.