model-writtenrun 9884 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Apr - Nov 2018 ยท 17 entries
- Andres Freund opened the thread after discussions with Linux developers, explaining that PostgreSQL incorrectly assumed write-back errors would persist until resolved and proposing PANIC on synchronization failures plus descriptor retention to prevent errors disappearing between close and reopen #1.
- Bruce Momjian favored shutting down without automatic recovery after storage failures, while Andres defended the existing crash-recovery model and Stephen Frost noted that recovery could free temporary storage; direct I/O and administrator hooks were discussed but offered no immediate general solution #2 #5 #7 #13.
- Craig Ringer questioned whether sync_file_range() and msync() could consume errors; Andres distinguished their kernel behavior, and Craig's first attachment added PANIC handling for critical fsync calls and msync failures #25 #26 #31.
- Andres requested centralized error handling and close() coverage, and Robert Haas proposed an error-level helper; Craig subsequently incorporated that approach and audited close() callers in his revised PANIC patch #32 #33 #52.
- In a parallel effort, Andres introduced descriptor transfer through Unix sockets, abandoning an attempted shared hash table because safe concurrent iteration was difficult; the checkpointer would retain descriptors and synchronize files early when approaching descriptor limits #35.
- Thomas Munro's testing found nonportable SOCK_CLOEXEC use and failures during initialization, prompting Andres to replace transient-file tracking with virtual files kept outside the LRU and repair single-user operation #39 #44.
- Dmitry Dolgov exposed a socket-buffer hang, and Andres accidentally attached an unrelated atomics patch before supplying the missing dirty-cycle assignment; Dmitry's backtrace also established a checkpointer self-deadlock that the assignment fix merely made harder to trigger #45 #47 #49 #50 #51.
- Thomas's detailed descriptor-transfer review identified that the first descriptor received need not be the oldest opened, questioned stream-message atomicity, and examined descriptor limits and Windows handle accounting #53.
- Robert's review of the PANIC patch found missing SLRU coverage and requested clearer error handling and an escape-hatch setting, while Thomas explained that allowing retries also required preserving failed fsync requests #54 #55.
- Thomas supplied descriptor-transfer fixups using portable close-on-exec calls, checkpoint counters instead of self-enqueued synchronization tokens, postmaster-death detection and macOS error retries, while leaving Windows support and descriptor ordering for further work #57.
- Craig stepped back because the broader changes exceeded his available time and expertise, while maintaining that the PANIC patch remained necessary #60.
- Thomas added EXEC_BACKEND support, Windows asynchronous pipe handling and opening sequence numbers to address descriptor ordering, then consolidated the Unix implementation and kept Windows separate while fixing a crash-recovery assertion #61 #63.
- Thomas narrowed the backpatch plan to the PANIC fix because descriptor transfer was too invasive and insufficiently tested across kernels; his revision added data_sync_retry, treated all synchronization error codes alike, covered SLRUs and sync_file_range(), improved temporary-file detection, and bundled failed-request preservation #64.
- Robert reviewed the revised pair and questioned whether merging pending request bitmaps could fail; Thomas explained that bms_join() avoids allocation, resolving the concern, and also accepted a documentation typo correction #67 #68 #69.
- Fault-injection testing uncovered missing error promotion in fsync_fname(), which Thomas fixed before demonstrating that retry mode retained failed requests and default mode caused PANIC; the final submission included the throwaway testing patch #70.
- Thomas committed the PANIC component of #70 unchanged as 9ccdd7f66e, retaining Craig's authorship credit, and announced that the production fixes had been pushed to all supported branches #71.
- The thread ended with the backpatchable fixes landed and fault injection left out, while descriptor retention continued in a separate development-branch redesign; Thomas also left open whether close()-triggered PANIC fully protects against concurrent checkpoints, particularly on NFS #70 #71.