model-writtenrun 1366 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Sep 2025 - Jan 2026 · 25 entries
- 蔡梦娟(玊于), signing as suyu.cmj, opened the thread with a reproducer showing that checkpoint WAL cleanup could invalidate a newly created replication slot, and also questioned invalidation based on an outdated restart_lsn in #1.
- Vitaly Davydov adapted the reproducer for different branches and proposed considering both the checkpoint-start and current minimum slot LSN during WAL cleanup in #2.
- Amit Kapila recommended separating the outdated-restart_lsn behavior from this race, and the reporter moved that question to another thread in #4 and #5.
- Amit identified a remaining timing window, Hayato Kuroda demonstrated it with a test delta, and Vitaly acknowledged that his revised fix only reduced the race's likelihood in #6, #7, and #8.
- Hayato added a logical-slot reproducer on a standby in #12, while Vitaly changed the proposed fix to recompute required slot LSNs after establishing the checkpoint redo pointer and expanded physical/logical tests in #13.
- Vitaly then demonstrated that reading the redo pointer and assigning restart_lsn non-atomically could reproduce the problem even on HEAD in #15, overturning the earlier belief that newer branches were protected.
- Hayato's attempt to publish the candidate LSN earlier still left another invalidation window in #16, leading Alexander Korotkov to propose a dedicated WAL-reservation lock in #17.
- Amit instead proposed reusing ReplicationSlotAllocationLock to serialize reservation with slot checkpointing in #18, and Hayato confirmed that synchronized slots had related races with new reproducers in #21.
- Zhijie Hou implemented the existing-lock approach in #23, while Vitaly supplied an experimental lockless two-phase reservation delta but endorsed the locking solution as less risky in #25.
- Vitaly's questions about concurrent minimum-LSN updates led Hou to add another locking fix and remove the ordinary reservation retry loop in #26.
- Hou found that allocation locking alone could not protect synchronized slots whose remote restart_lsn was already behind the standby redo pointer, so he introduced a safe local WAL horizon in #27 and corrected its comparison while adding a test in #28.
- Vitaly's lock-order and performance review in #29 prompted Hou to limit exclusive control locking to initial reservation in #30, and Amit's request to separate the bugs led to a three-patch split in #32.
- Masahiko Sawada investigated whether slot copying had the same problem, accepted Hou's explanation of current interrupt handling, and requested checkpoint-side documentation while raising concerns about changing the replication-slot structure on stable branches in #33, #36, and #37.
- Hou narrowed the immediate submission to the ordinary reservation fix for HEAD and PostgreSQL 18 in #39, leaving out a test because the protected behavior would principally exercise an LWLock wait, and incorporated Amit's comment edits in #41.
- Amit committed the final HEAD reservation fix from #41 as 006dd4b2e5, with editorial preparation and PostgreSQL 18 coverage, and announced the push in #43.
- For older branches, Hou proposed additionally locking checkpoint minimum-LSN sampling in #44 and documented its special purpose in #48, avoiding a replacement of the older branch implementation.
- Alexander identified extensions that depend on the replication-slot structure's size in #51, ruling against changing that structure on stable branches, while discussion of a new LWLock ultimately favored reusing the existing lock to reduce compatibility risk in #52, #53, and #54.
- Amit clarified why subsequent minimum-LSN recalculations need no additional lock in #55, Masahiko accepted the explanation in #56, and Vignesh supplied formatted and tested adaptations through PostgreSQL 14 in #57.
- Hayato confirmed the backbranch fix and reviewed its lock ordering in #59 and #60, after which Amit reported that the older-branch counterparts of 006dd4b2e5 had been pushed in #61.
- Hou resumed the synchronized-slot remainder with its regression test in #62, explicitly reserving the separate concurrent minimum-LSN update problem for another thread.
- Hayato reproduced the synchronized-slot failure, verified the fix, and found that the proposed test did not expose invalidation in #63; Hou revised the test and adopted a direct Max assignment in #64, then addressed further include and safe_psql feedback in #66.
- Amit requested clearer safe-horizon explanations and less test logging in #67, which Hou incorporated into the combined final patch and branch variants in #68.
- Hayato verified the final patches across branches in #69, and Chao Li endorsed them while identifying minor wording errors in #70.
- Amit committed #68 as 851f6649cc with only source-comment and commit-text changes, backpatched through PostgreSQL 17, and announced completion in #71.
- At the thread's end, the ordinary and synchronized-slot reservation fixes had landed with their backports, while the distinct concurrent minimum-LSN update issue remained outside these commits and was designated for separate discussion in #62.