index d0ec6a834be8cee431ac3f8f0719e1ffebc5b502..e51a7a749da949997f95546d38ee0af06b626c5d 100644 (file)
{
ResetLatch(&XLogCtl->recoveryWakeupLatch);
- /* might change the trigger file's location */
+ /*
+ * This might change recovery_min_apply_delay or the trigger file's
+ * location.
+ */
HandleStartupProcInterrupts();
if (CheckForStandbyTrigger())
break;
/*
- * Wait for difference between GetCurrentTimestamp() and delayUntil
+ * Recalculate delayUntil as recovery_min_apply_delay could have
+ * changed while waiting in this loop.
+ */
+ delayUntil = TimestampTzPlusMilliseconds(xtime, recovery_min_apply_delay);
+
+ /*
+ * Wait for difference between GetCurrentTimestamp() and delayUntil.
*/
msecs = TimestampDifferenceMilliseconds(GetCurrentTimestamp(),
delayUntil);