WalSndWakeupProcessRequests(true, !RecoveryInProgress());
/*
- * If we flushed an LSN that someone was waiting for, notify the waiters.
+ * Wake up processes waiting for primary flush LSN to reach current flush
+ * position.
*/
- if (waitLSNState &&
- (LogwrtResult.Flush >=
- pg_atomic_read_u64(&waitLSNState->minWaitedLSN[WAIT_LSN_TYPE_PRIMARY_FLUSH])))
- WaitLSNWakeup(WAIT_LSN_TYPE_PRIMARY_FLUSH, LogwrtResult.Flush);
+ WaitLSNWakeup(WAIT_LSN_TYPE_PRIMARY_FLUSH, LogwrtResult.Flush);
/*
* If we still haven't flushed to the request point then we have a
WalSndWakeupProcessRequests(true, !RecoveryInProgress());
/*
- * If we flushed an LSN that someone was waiting for, notify the waiters.
+ * Wake up processes waiting for primary flush LSN to reach current flush
+ * position.
*/
- if (waitLSNState &&
- (LogwrtResult.Flush >=
- pg_atomic_read_u64(&waitLSNState->minWaitedLSN[WAIT_LSN_TYPE_PRIMARY_FLUSH])))
- WaitLSNWakeup(WAIT_LSN_TYPE_PRIMARY_FLUSH, LogwrtResult.Flush);
+ WaitLSNWakeup(WAIT_LSN_TYPE_PRIMARY_FLUSH, LogwrtResult.Flush);
/*
* Great, done. To take some work off the critical path, try to initialize
ApplyWalRecord(xlogreader, record, &replayTLI);
/*
- * If we replayed an LSN that someone was waiting for then walk
- * over the shared memory array and set latches to notify the
- * waiters.
+ * Wake up processes waiting for standby replay LSN to reach
+ * current replay position.
*/
- if (waitLSNState &&
- (XLogRecoveryCtl->lastReplayedEndRecPtr >=
- pg_atomic_read_u64(&waitLSNState->minWaitedLSN[WAIT_LSN_TYPE_STANDBY_REPLAY])))
- WaitLSNWakeup(WAIT_LSN_TYPE_STANDBY_REPLAY, XLogRecoveryCtl->lastReplayedEndRecPtr);
+ WaitLSNWakeup(WAIT_LSN_TYPE_STANDBY_REPLAY,
+ XLogRecoveryCtl->lastReplayedEndRecPtr);
/* Exit loop if we reached inclusive recovery target */
if (recoveryStopsAfter(xlogreader))
pg_atomic_write_membarrier_u64(&WalRcv->writtenUpto, LogstreamResult.Write);
/*
- * If we wrote an LSN that someone was waiting for, notify the waiters.
+ * Wake up processes waiting for standby write LSN to reach current write
+ * position.
*/
- if (waitLSNState &&
- (LogstreamResult.Write >=
- pg_atomic_read_u64(&waitLSNState->minWaitedLSN[WAIT_LSN_TYPE_STANDBY_WRITE])))
- WaitLSNWakeup(WAIT_LSN_TYPE_STANDBY_WRITE, LogstreamResult.Write);
+ WaitLSNWakeup(WAIT_LSN_TYPE_STANDBY_WRITE, LogstreamResult.Write);
/*
* Close the current segment if it's fully written up in the last cycle of
SpinLockRelease(&walrcv->mutex);
/*
- * If we flushed an LSN that someone was waiting for, notify the
- * waiters.
+ * Wake up processes waiting for standby flush LSN to reach current
+ * flush position.
*/
- if (waitLSNState &&
- (LogstreamResult.Flush >=
- pg_atomic_read_u64(&waitLSNState->minWaitedLSN[WAIT_LSN_TYPE_STANDBY_FLUSH])))
- WaitLSNWakeup(WAIT_LSN_TYPE_STANDBY_FLUSH, LogstreamResult.Flush);
+ WaitLSNWakeup(WAIT_LSN_TYPE_STANDBY_FLUSH, LogstreamResult.Flush);
/* Signal the startup process and walsender that new WAL has arrived */
WakeupRecovery();