From: Aidar Imamov Subject: [PATCH] Fix recovery conflict canceling the startup progress timeout ResolveRecoveryConflictWithLock() and ResolveRecoveryConflictWithBufferPin() end with disable_all_timeouts(false), which cancels every timeout the startup process has, not just the two these functions enable. Since commit 9ce346eabf3 the startup process also has STARTUP_PROGRESS_TIMEOUT, so a single recovery conflict stops "redo in progress" messages for the rest of the redo, even though redo keeps going. Cancel only the two timeouts each function enables. --- src/backend/storage/ipc/standby.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c index 7f011e04990..32b19814c6f 100644 --- a/src/backend/storage/ipc/standby.c +++ b/src/backend/storage/ipc/standby.c @@ -754,12 +754,12 @@ ResolveRecoveryConflictWithLock(LOCKTAG locktag, bool logging_conflict) cleanup: /* - * Clear any timeout requests established above. We assume here that the - * Startup process doesn't have any other outstanding timeouts than those - * used by this function. If that stops being true, we could cancel the - * timeouts individually, but that'd be slower. + * Cancel only the timeouts established above. The startup process also + * has STARTUP_PROGRESS_TIMEOUT, which must not be canceled here, or + * recovery progress reporting would stop for the rest of the redo. */ - disable_all_timeouts(false); + disable_timeout(STANDBY_LOCK_TIMEOUT, false); + disable_timeout(STANDBY_DEADLOCK_TIMEOUT, false); got_standby_lock_timeout = false; got_standby_deadlock_timeout = false; } @@ -865,12 +865,12 @@ ResolveRecoveryConflictWithBufferPin(void) } /* - * Clear any timeout requests established above. We assume here that the - * Startup process doesn't have any other timeouts than what this function - * uses. If that stops being true, we could cancel the timeouts - * individually, but that'd be slower. + * Cancel only the timeouts established above. The startup process also + * has STARTUP_PROGRESS_TIMEOUT, which must not be canceled here, or + * recovery progress reporting would stop for the rest of the redo. */ - disable_all_timeouts(false); + disable_timeout(STANDBY_TIMEOUT, false); + disable_timeout(STANDBY_DEADLOCK_TIMEOUT, false); got_standby_delay_timeout = false; got_standby_deadlock_timeout = false; } -- 2.47.1