model-writtenrun 3130 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Feb - Jul 2024 ยท 27 entries
- Vitaly Davydov opened the thread with a logical-replication catchup problem: two-phase transactions forced WAL flushes on the subscriber, whose serial apply worker could not match a busy publisher's throughput #1.
- Vitaly's first prototype made prepare and commit-prepared asynchronous and cached prepared state in worker-local memory so completion would not wait to read unflushed WAL #7.
- Vitaly replaced that cache with unsynced pg_twophase files and recovery filtering for future transaction IDs #10, but Heikki Linnakangas objected that losing an acknowledged prepared transaction after a crash violated the required semantics #11.
- Vitaly explained that he wanted two-phase replication during normal operation but could disable it during catchup if the option were alterable #12; after roughly a month, Ajin Cherian introduced a separate subscription-toggle patch developed with Hayato Kuroda #14.
- Ajin added remote slot updates and identified three constraints: outstanding subscriber prepares could be applied twice, enabling two-phase could produce a commit without its prepare, and an active walsender prevented remote slot alteration #16.
- Amit Kapila explored tracking which prepares had been sent #17, while Hayato considered sending prepared-transaction lists but rejected the communication and complexity costs in favor of an initially restrictive five-patch series requiring disabled subscriptions and no conflicting prepared transactions #20.
- Vitaly clarified his multimaster requirements #22, and Ajin independently reproduced the slow catchup with twenty pgbench clients #25.
- Ajin and Hayato found that the existing two_phase_at mechanism already handled transactions prepared before enablement, so they deferred enabling the remote slot until replication restarted and added automatic subscriber rollback for disabling two-phase #26.
- Ajin questioned unconditional rollback #27, leading Hayato to add force_alter so users would explicitly request that behavior #29.
- Hayato supplied a PostgreSQL 16 port for Vitaly's testing, explicitly warning that its ABI changes prevented a stable-branch backpatch #30, while development continued separately on the main series #32.
- Peter Smith's detailed review prompted moving GID construction into twophase.c, improving helper names and tests #33, and subsequently fixing malformed multi-option replication commands and strengthening test coverage #36 #42.
- Peter argued that force_alter should also be accepted at subscription creation and persist across commands #45, so Hayato added a catalog field and corresponding dump, display and documentation support #46 #48.
- Further May reviews corrected catalog indexing, redundant conditions, broken SGML and inconsistent explanations, ending with Peter confirming his comments were addressed #51 #55 #58 #59.
- After a gap until late June, Hayato repaired a CI failure caused by a missing comma in the new pg_dump query and refreshed formatting #60 #61.
- Amit requested notification before automatic rollback and challenged stopping workers as part of alteration #62 #64; Hayato changed the operation to reject active workers, added polling to the tests and consolidated them into 021_twophase.pl #65 #66.
- Vitaly reported that the feature generally worked but crashed when altering a subscription without a slot #67, and Hayato added slot-name validation while explaining why outstanding prepared transactions retained their WAL #68.
- Amit identified that rolling back prepared transactions before a remote-slot or catalog error could permanently lose their prepared state, and that reversing the operation order also remained unsafe #69 #70.
- Hayato therefore removed automatic rollback and force_alter, documented manual resolution of prepared transactions, unified common checks, and restricted simultaneous slot-name changes #72, then immediately corrected uninitialized update flags #73.
- Hou Zhijie found that ALTER_REPLICATION_SLOT reset unspecified options and supplied a fix using nullable option arguments plus protocol documentation #74; Hayato folded it into the full series #76.
- Hou then identified that sscanf accepted GIDs with invalid suffixes #78, leading to exact reconstructed-string comparison #81; Peter caught an incorrect buffer-size argument in that implementation #82, which Hayato corrected #85.
- Hou reported successful testing of both toggle directions and confirmed that outstanding prepared transactions retained the WAL needed for replay #86.
- Amit took over final preparation, merged the three remaining patches, simplified option checks and removed unrelated documentation changes #87.
- Vignesh C requested guidance for identifying subscriber prepared transactions and corrected subscription-OID validation #92, while Amit and Hayato agreed to retain the disabled-subscription restriction for consistency even where enablement could theoretically be less restrictive #91 #93.
- Amit incorporated those suggestions and Peter's const and naming feedback #95, then applied Peter's final wording corrections and announced readiness to commit #96 #97.
- The subscription-toggle feature landed from #97 as 1462aad2e4 with cosmetic edits, and Amit confirmed the push and closure of the commitfest entry #98 #100.
- Vignesh subsequently reproduced an intermittent TAP failure by delaying worker exit and found that two polling queries used the wrong backend_type string #101; 0dcea330ba took both query corrections while excluding the diagnostic delay.
- The final thread message is Amit's approval of that test fix #102, which landed the following day as 0dcea330ba; the feature and follow-up repair are committed, while asynchronous prepare, automatic rollback and force_alter were not included.