model-writtenrun 182 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Egor Chindyaskin reported that creating and dropping an ENABLE ALWAYS login event trigger on the primary could leave standby connections failing with a forbidden AccessExclusiveLock request #1.
- Ayush Tiwari traced the failure to lazy cleanup of pg_database.dathasloginevt and proposed skipping that cleanup during recovery, leaving the standby flag to WAL replay #2; Fujii Masao approved the fix and supported backpatching through PostgreSQL 17 #3.
- Alexander Korotkov added a recovery test #4, but Fujii Masao observed that its synchronization helper could connect to the primary and prematurely clear the flag #5; Ayush proposed capturing the WAL position in the existing session #6 and incorporated that strategy into a revised patch #7.
- Alexander replaced the explicit-WAL-position strategy with a dedicated test database, isolated from synchronization connections, and added checks for primary cleanup and replay of the cleared flag, forcing a WAL flush for the in-place update #8; Ayush endorsed this approach #9.
- After announcing his intention to push and backpatch #10, Alexander committed the final attached patch unchanged as bec61f5935, with backports through PostgreSQL 17.
- Months later, Alexander Lakhin reported buildfarm failures and reproduced them under Valgrind, showing that concurrent autovacuum startup could prevent the conditional database lock from being acquired and leave the flag uncleared #11.
- Ayush supplied a follow-up test fix that retries fresh connections until cleanup succeeds before checking WAL replay #12, and Fujii approved it #13.
- Fujii committed the retry patch with only whitespace changes as 80cf511236, backpatched it through PostgreSQL 17, and confirmed completion in the final message #14; no attached work remained pending.