model-writtenrun 8077 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Paul Guo opened the thread with two performance concerns: recursively syncing the data directory delayed crash recovery, and syncing prepared-transaction files individually might slow checkpoints #1.
- Fujii Masao suggested excluding disposable directories, Michael Paquier requested measurements before complicating two-phase handling, and Tom Lane warned that some filesystems require the existing syncs #2 #3 #5.
- Robert Haas described startup delays lasting minutes and requested progress reporting; Thomas Munro proposed deferring relation syncs to checkpoints or identifying necessary files from WAL, while Robert warned about previously disabled fsync and unsynchronized filesystem copies #6 #7 #8.
- Craig Ringer suggested parallel syncing, and Thomas Munro developed a possible checkpointer-based design while leaving file-opening costs, presync timing, and layering unresolved #9 #10.
- Thomas Munro separately proposed deferring prepared-transaction syncs through sync.c, then withdrew that suggestion after recognizing that he had misunderstood the existing behavior; no patch for the second original issue followed #11 #13.
- Following an off-list suggestion from Andres Freund reported in #12, Thomas Munro posted a Linux syncfs() prototype that avoided opening every file, noting missing error reporting before Linux 5.8 and synchronization of unrelated files on shared filesystems #14.
- Thomas Munro then posted a competing WAL-guided implementation that synced WAL before replay and queued relation syncs for pages skipped because of their LSNs, leaving treatment of some special files unresolved #15.
- Thomas Munro explained that the WAL-guided approach would prevent checkpoint completion on queued sync failures but would not protect unsynced changes predating the last checkpoint, unlike the broader guarantee attempted by filesystem-wide syncing #16.
- Michael Banck tested both patches on SAN storage with 250 databases and tablespaces: startup preparation fell from 12–13 seconds to usually under 10 milliseconds with syncfs() and approximately 4 milliseconds with the WAL-guided patch #17.
- Michael Banck questioned durability after restoring a base backup; Thomas Munro and Michael Paquier placed responsibility on copying tools, but Michael Banck emphasized that existing restore instructions did not require synchronization and that the WAL-guided patch would remove the current startup safeguard #18 #19 #20 #21.
- The thread ended with Craig Ringer proposing documentation of copying and synchronization responsibilities, Michael Paquier requesting a patch, and Craig deferring it until other documentation work was resolved; neither experimental implementation had landed within this discussion #22 #23 #24.
- The syncfs() approach subsequently landed as an optional recovery_init_sync_method setting in 61752afb26, sourced from the newer submission #472503 in thread #43831, with fsync retained as the default.