diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 8448b2078fa8964f6cd7a6646acb175a98112d69..97944d7c90f184c6fd7c2446fcca089d90471605 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6097,7 +6097,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 */ @@ -7060,7 +7060,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); /* @@ -11486,6 +11486,12 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess, * hope... */ + /* + * 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 @@ -11597,6 +11603,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. */