model-writtenrun 3432 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ronan Dunklau reported PostgreSQL 16 writes failing on blocks beyond the relation's end under heavy load #1, then confirmed invalid FSM entries and proposed an online FSM reset utility #2.
- Ronan supplied WAL evidence showing FSM entries for nonexistent blocks without relation truncation #5; Noah Misch identified how unlogged relation extension could leave those entries after recovery and outlined either resilient FSM consumers or stricter WAL ordering #6.
- Ronan confirmed recovery was necessary to reproduce the failure #9, while Noah favored resilience because stricter WAL ordering would still leave torn-page cases and require changes across access methods #8.
- Ronan's first automatic fix rejected out-of-range FSM results in heap insertion and fell back to relation extension #13; Patrick Stählin identified a size-check ordering race #14, which Ronan corrected in #15.
- Noah requested protection for all FSM consumers and fewer relation-size system calls #16, leading Ronan to move validation into freespace.c and mark invalid entries full before continuing the search #17.
- Noah showed that trusting a stale size cache could discard valid pages created by concurrent extension #18; Ronan adopted a fresh size lookup when the cache could not establish existence, retaining the centralized repair design #19.
- Performance testing initially suggested roughly a one-percent slowdown #21, but further checks showed the benchmark barely exercised the relevant behavior #24, and profiling found lseek samples rising only from 0.01% to 0.02% #25.
- Noah validated the fix against an existing truncation recovery test, reformatted Ronan's patch, expanded its comments, and accepted the remaining performance uncertainty #26; he also attached a separate visibility-map WAL-removal experiment for possible PostgreSQL 18 work in another thread.
- Peter Geoghegan raised a separate concern about updating the FSM search cursor under a shared lock #29; Noah saw no correctness issue #30, while Thomas Munro noted a possible interaction with direct I/O on checksummed filesystems #31, without a resulting patch here.
- Noah committed the FSM attachment from #26 unchanged as 9358297431, excluding the visibility-map experiment; backpatching stopped at PostgreSQL 14 because older branches lacked the relation-size cache and additional system calls seemed unjustified without reports #32.
- Ronan accepted that backpatch boundary and reiterated manual FSM removal or the separately proposed online repair utility as workarounds #33; the automatic FSM fix had landed, while the reset utility and visibility-map experiment remained outside this commit.