=== Applying patches on top of PostgreSQL commit ID e2362eb2bd1459319dacaeaa5dc886dbca546b96 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Fri Jan 30 17:46:23 UTC 2026 On branch cf/6445 nothing to commit, working tree clean === using 'git am' to apply patch ./v1-0001-Set-1s-WaitLatch-timeout-if-standby-limit-has-exp.patch === Applying: Set 1s WaitLatch timeout if standby limit has expired in ResolveRecoveryConflictWithBufferPin Using index info to reconstruct a base tree... M src/backend/storage/ipc/standby.c M src/backend/storage/lmgr/proc.c M src/include/storage/proc.h Falling back to patching base and 3-way merge... Auto-merging src/include/storage/proc.h Auto-merging src/backend/storage/lmgr/proc.c Auto-merging src/backend/storage/ipc/standby.c CONFLICT (content): Merge conflict in src/backend/storage/ipc/standby.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Set 1s WaitLatch timeout if standby limit has expired in ResolveRecoveryConflictWithBufferPin When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Unstaged changes after reset: M src/backend/storage/ipc/standby.c M src/backend/storage/lmgr/proc.c M src/include/storage/proc.h === using patch(1) to apply patch ./v1-0001-Set-1s-WaitLatch-timeout-if-standby-limit-has-exp.patch === patching file src/backend/storage/ipc/standby.c Hunk #2 FAILED at 837. 1 out of 2 hunks FAILED -- saving rejects to file src/backend/storage/ipc/standby.c.rej patching file src/backend/storage/lmgr/proc.c Hunk #1 succeeded at 1971 (offset 6 lines). patching file src/include/storage/proc.h Hunk #1 succeeded at 519 (offset 14 lines). Unstaged changes after reset: M src/backend/storage/ipc/standby.c M src/backend/storage/lmgr/proc.c M src/include/storage/proc.h Removing src/backend/storage/ipc/standby.c.rej === using 'git apply' to apply patch ./v1-0001-Set-1s-WaitLatch-timeout-if-standby-limit-has-exp.patch === Applied patch to 'src/backend/storage/ipc/standby.c' with conflicts. Applied patch to 'src/backend/storage/lmgr/proc.c' cleanly. Applied patch to 'src/include/storage/proc.h' cleanly. U src/backend/storage/ipc/standby.c diff --cc src/backend/storage/ipc/standby.c index afffab77106,ff9070aba35..00000000000 --- a/src/backend/storage/ipc/standby.c +++ b/src/backend/storage/ipc/standby.c @@@ -835,12 -837,14 +837,18 @@@ ResolveRecoveryConflictWithBufferPin(vo * Wait to be signaled by UnpinBuffer() or for the wait to be interrupted * by one of the timeouts established above. * - * We assume that only UnpinBuffer() and the timeout requests established - * above can wake us up here. WakeupRecovery() called by walreceiver or - * SIGHUP signal handler, etc cannot do that because it uses the different - * latch from that ProcWaitForSignal() waits on. + * If the standby limit has already expired, we also set a 1s timeout. This + * is to ensure the startup process is still woken up in a reasonable time + * in case a new backend sneaks in and acquires a conflicting pin before the + * original conflicting backends are able to cancel themselves and reduce + * the pin count to 1 (which wakes up the startup process). */ ++<<<<<<< ours + ProcWaitForSignal(WAIT_EVENT_BUFFER_CLEANUP); ++======= + ProcWaitForSignalWithTimeout(WAIT_EVENT_BUFFER_PIN, + standby_limit_expired ? 1000 : 0); ++>>>>>>> theirs if (got_standby_delay_timeout) SendRecoveryConflictWithBufferPin(PROCSIG_RECOVERY_CONFLICT_BUFFERPIN);