aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/xlog.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 0378b870bdc..b602e28f619 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6354,7 +6354,7 @@ StartupXLOG(void)
* Take ownership of the wakeup latch if we're going to sleep during
* recovery.
*/
- if (StandbyModeRequested)
+ if (ArchiveRecoveryRequested)
OwnLatch(&XLogCtl->recoveryWakeupLatch);
/* Set up XLOG reader facility */
@@ -7338,7 +7338,7 @@ StartupXLOG(void)
* We don't need the latch anymore. It's not strictly necessary to disown
* it, but let's do it for the sake of tidiness.
*/
- if (StandbyModeRequested)
+ if (ArchiveRecoveryRequested)
DisownLatch(&XLogCtl->recoveryWakeupLatch);
/*
@@ -11874,6 +11874,12 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
*/
/*
+ * We should be able to move to XLOG_FROM_STREAM
+ * only in standby mode.
+ */
+ Assert(StandbyMode);
+
+ /*
* Before we leave XLOG_FROM_STREAM state, make sure that
* walreceiver is not active, so that it won't overwrite
* WAL that we restore from archive.
@@ -11987,6 +11993,12 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
bool havedata;
/*
+ * We should be able to move to XLOG_FROM_STREAM
+ * only in standby mode.
+ */
+ Assert(StandbyMode);
+
+ /*
* Check if WAL receiver is still active.
*/
if (!WalRcvStreaming())