Skip to content

Commit 8d09192

Browse files
committed
Make the standby server promptly handle interrupt signals.
This commit changes the startup process in the standby server so that it handles the interrupt signals after waiting for wal_retrieve_retry_interval on the latch and resetting it, before entering another wait on the latch. This change causes the standby server to promptly handle interrupt signals. Otherwise, previously, there was the case where the standby needs to wait extra five seconds to shutdown when the shutdown request arrived while the startup process was waiting for wal_retrieve_retry_interval on the latch. Author: Fujii Masao, but implementation idea is from Soumyadeep Chakraborty Reviewed-by: Soumyadeep Chakraborty Discussion: https://postgr.es/m/9d7e6ab0-8a53-ddb9-63cd-289bcb25fe0e@oss.nttdata.com Per discussion of BUG #17073, back-patch to all supported versions. Discussion: https://postgr.es/m/17073-1a5fdaed0fa5d4d0@postgresql.org
1 parent f47408c commit 8d09192

File tree

1 file changed

+3
-0
lines changed
  • src/backend/access/transam

1 file changed

+3
-0
lines changed

src/backend/access/transam/xlog.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12231,6 +12231,9 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
1223112231
WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL);
1223212232
ResetLatch(&XLogCtl->recoveryWakeupLatch);
1223312233
now = GetCurrentTimestamp();
12234+
12235+
/* Handle interrupt signals of startup process */
12236+
HandleStartupProcInterrupts();
1223412237
}
1223512238
last_fail_time = now;
1223612239
currentSource = XLOG_FROM_ARCHIVE;

0 commit comments

Comments
 (0)