aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2020-11-16 18:27:51 +0900
committerFujii Masao <fujii@postgresql.org>2020-11-16 18:27:51 +0900
commit2945a488a3426838223a637cd326ec71fff61954 (patch)
treee848844e569a2d4da5f5e3455190f97c6305812c /src/backend
parent7adb8feb0f69fd9c79078c6cea984bb4bff1c841 (diff)
downloadpostgresql-2945a488a3426838223a637cd326ec71fff61954.tar.gz
postgresql-2945a488a3426838223a637cd326ec71fff61954.zip
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
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/access/transam/xlog.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index aa63f376159..7d97b96e728 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -12225,6 +12225,9 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL);
ResetLatch(MyLatch);
now = GetCurrentTimestamp();
+
+ /* Handle interrupt signals of startup process */
+ HandleStartupProcInterrupts();
}
last_fail_time = now;
currentSource = XLOG_FROM_ARCHIVE;