model-writtenrun 598 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Artem Anisimov reported that adding a hash or btree index allowed concurrent SERIALIZABLE transactions to violate an exclusive-lock invariant, supplying a multithreaded C reproducer in #1; Thomas Munro reproduced the anomaly and identified a bitmap heap scan plan in #2.
- Thomas narrowed one failure to initially empty btrees and demonstrated a schedule where insertion occurs between the empty-index search and predicate locking, leaving neither reader nor writer able to detect the conflict #6 #7 #8.
- Thomas posted a btree fix that repeats the search after acquiring the relation predicate lock, while noting that bitmap heap scans still failed #9; he then identified the bitmap scan shortcut that skipped blocks beyond the initially observed table size and disabled it inline #10.
- Dmitry Dolgov confirmed that the two changes stopped the original failure but found a similar anomaly with GIN indexes #11; Thomas packaged the first two fixes and identified a separate GIN mistake that passed a buffer identifier where a block number was required #12.
- The GIN investigation narrowed the failure to fast updates: Dmitry found that disabling fastupdate avoided it and supplied experimental extra locking, while Thomas established that posting-tree conflict checking already existed #17 #18 #19.
- Thomas rejected the need for Dmitry's broad additional locking and instead moved GIN's conflict checks after acquiring the metapage buffer lock, adding this third fix alongside the buffer-to-block-number correction #20.
- Peter Geoghegan explained that preallocating an empty btree leaf could avoid the special case but did not advocate sacrificing lazy allocation; Thomas also considered creating the root on demand and retained the simpler recheck approach #21 #23.
- Heikki Linnakangas endorsed the series, requested tests, asked to preserve the original btree explanation, and proposed keeping the bitmap optimization outside SSI #22; Thomas incorporated both requested changes but could not construct deterministic tests with the available infrastructure #24.
- Thomas committed the final series and announced completion in #25: the btree fix gained an access/xact.h include in 0cb1fb2c9b, the bitmap fix landed unchanged in d03d9a2614, and the GIN fix landed with whitespace cleanup in 12529028a4, all from #24.
- Artem questioned the absence of regression tests after the fixes landed #26; Thomas explained that statement-level isolation tests could not force these internal scheduling windows and discussed possible controlled waitpoints or statistical stress tests without adding either #27.
- Three years later, Peter found that scans without useful insertion keys bypassed the repaired path through _bt_endpoint(), and the thread's final message supplied a follow-up fix plus injection-point tests covering both empty-index paths #28.
- The supplied commit history shows both parts of Peter's final submission subsequently landed: 2fc3e1b44a adapts the endpoint fix to its target branch, and 62c05d6f2f relocates and refines the tests from #28, with no later review messages or outstanding attached patches in the supplied thread.