model-writtenrun 7058 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Mar - Jun 2025 ยท 27 entries
- Zhijie Hou opened the thread with a failover reproducer showing that transactions prepared before two-phase decoding was enabled could disappear from replication, and proposed exposing and synchronizing two_phase_at rather than making option changes wait for prepared transactions #1.
- Amit Kapila questioned the initial belief that only HEAD was affected and reviewed the synchronization and test details; Hou subsequently reproduced the problem on PostgreSQL 17 and proposed a separate prohibition on combining failover and two-phase decoding because the catalog-changing HEAD fix could not be backpatched #3 #4.
- Amit favored an explicit restriction over silently withholding synchronization, and his fix-ups led to ALTER SUBSCRIPTION checks, revised diagnostics, and regression-test adjustments in the completed two-variant submission #5 #6 #8 #9.
- Masahiko Sawada challenged the breadth of the PostgreSQL 17 restriction, but Hou demonstrated unsafe cases during both table synchronization and snapshot construction; a proposed sync-ready delay also proved problematic because an already-ready slot could later enable two-phase decoding #10 #11 #12 #13 #14.
- Masahiko supported landing HEAD independently, and Amit committed its component from #9 as 4868c96bc8, adding the catalog-version bump while leaving the PostgreSQL 17 solution open #15 #16.
- Hou outlined three PostgreSQL 17 approaches: prohibit the combination entirely, detect unsafe prepared transactions during creation, or prohibit combined creation but permit failover later after restart_lsn passes two_phase_at; Nisha Moond supplied implementations of all three, crediting Hou for Approach 2 #18 #19.
- A buildfarm assertion failure exposed a second synchronization problem: two_phase_at could advance without confirmed_flush when the standby slot's horizons were ahead, so Hou proposed forcing confirmed_flush forward and Amit suggested the simpler alternative of postponing all configuration updates #20 #22.
- That investigation uncovered a broader fast-forward decoding bug: Amit identified the risk of premature catalog removal, and Hou supplied an isolation test demonstrating that missing base snapshots allowed catalog_xmin to advance too far, then moved the complete fix to a separate thread #25 #26.
- Meanwhile, reviews by Masahiko and shveta malik exposed table-synchronization and option-check gaps in Approach 2, which Nisha corrected in a focused revision #23 #27 #29.
- Masahiko then proposed a simpler two-step subscription workflow, and Amit favored its smaller backbranch changes; Nisha returned to Approach 3, requiring two-phase readiness and a safe restart_lsn before enabling failover #30 #31 #32.
- Shveta and Masahiko requested clearer errors, documentation, and positive and negative tests, producing a fuller Approach 3 patch, while automatic advancement for SQL-created slots was judged too complex and risky for the backbranch #33 #35 #37 #39 #47.
- The fast-forward fix landed from the later submission #590235 in thread #51476 as 1f63b3626a, retaining the isolation test introduced here in #26 and adding decode.c changes that build base snapshots during fast-forward decoding; Hou acknowledged its landing before resuming the assertion fix #41.
- Hou demonstrated that standby slot horizons could still legitimately run ahead after the xmin fix and replaced forced confirmed_flush updates with an early return; Shveta approved that approach, Hou supplied a revised patch and reproduction instrumentation, and Masahiko requested an invariant assertion #41 #42 #44 #48 #46.
- Amit committed #44 as 3ff2a1f0c9, rewriting comments and adding the correctly directed two_phase_at <= confirmed_flush assertion; the commit omitted a dedicated test because reliable reproduction required intrusive timing controls #50.
- The PostgreSQL 17 patch continued through documentation and test revisions, including user-facing explanations instead of references to an unexposed LSN, Masahiko's comment fix-up, and a stable negative test using an unconsumed slot without an active subscription #43 #51 #52 #55.
- The newly added assertion itself then failed on the buildfarm, with Hou and Tom Lane reporting failures and Masahiko proposing that the primary slot's confirmed_flush could move backward #53 #54 #57 #58.
- Amit explained how keepalive acknowledgments followed by an apply-worker restart could send an older persisted origin position, and Masahiko identified the associated duplicate-data risk; Hou's injection-point reproducer confirmed both the assertion failure and duplication without slot synchronization #60 #61 #64.
- Hou extended that reproduction to PostgreSQL 17 using table-sync controls, while Shveta clarified the script after Amit questioned its timing #68 #71 #72.
- Shveta supplied the resulting fix in #591106 in thread #51570, and its implementation landed as e323d9df00, preventing both confirmed_flush assignments from retreating while omitting reproduction instrumentation; Nisha reported backpatches through PostgreSQL 13 and no further observed buildfarm failures #73.
- For the PostgreSQL 17 workaround, Shveta restored attention to failover-upgrade coverage, Nisha temporarily used a separate subscription for it, and subsequent revisions improved documentation and test synchronization #56 #59 #66 #70 #75 #76.
- Masahiko identified that the restriction broke restoration of slots with both options during pg_upgrade, so Nisha added binary-upgrade exceptions and restored combined-option testing, relying on upgrade checks that changes are consumed and prepared transactions are absent #77 #78.
- Masahiko next raised ordinary dump-and-restore compatibility; after Nisha considered several alternatives, Amit proposed omitting failover=true when dumping two-phase subscriptions because an automatic ALTER SUBSCRIPTION would require a connection that dumps deliberately disable #79 #80 #81.
- Nisha added the pg_dump adjustment as a second patch, but Amit and Masahiko remained concerned that dumps produced before the proposed minor-release restriction would fail to restore afterward #82 #81 #83.
- Dilip Kumar questioned the restriction's usability and diagnostics, then accepted that PostgreSQL 17 lacked the catalog-based HEAD solution; Nisha revised errors and pg_dump documentation while preserving the approach #85 #86 #87 #90 #91.
- Reviews from Shveta, Ajin Cherian, and Peter Smith refined upgrade guarantees, option quoting, terminology, and the dump patch description in the final attached two-patch series #92 #93 #95 #97.
- The PostgreSQL 17 series remained uncommitted: Nisha and Shveta argued that documented upgrade practices avoided the dump incompatibility, but Masahiko emphasized that existing pg_dump backups must also remain usable #89 #94 #96 #99.
- At the thread's end, Shveta reopened the earlier alternative of reporting failover=false in pg_replication_slots until restart_lsn passes two_phase_at, aiming to preserve dump compatibility at the cost of temporarily withholding standby slot creation; no replacement patch or agreement is shown #100.