Arrange for signal to be resent in ResolveRecoveryConflictWithBufferPin Once the standby limit has expired, the startup process signals all backends once and then sleeps until UnpinBuffer() wakes it up. A backend that pins the buffer after it has processed the signal is never told to cancel, so replay can stay stuck for as long as that pin is held.
With this change, after standby limit has expired, the startup process will wake up once per second and re-broadcast the buffer pin conflict signal, so that new pinners will receive it and cancel themselves. Author: Anthony Hsu <[email protected]> Reported-by: Anthony Hsu <[email protected]> Reviewed-by: Dmytro Astapov <[email protected]> Reviewed-by: Shihao Zhong <[email protected]> Reviewed-by: Andrey Borodin <[email protected]> Reviewed-by: João Rito <[email protected]> Reviewed-by: Xuneng Zhou <[email protected]> Discussion: https://postgr.es/m/CALQc50gi-Kw9m1r6hytf12473-fCECy=q9jtks4anejfeyc...@mail.gmail.com Backpatch-through: 15 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ccd4c7a8f81ec74c9ba6c29efd07b801edf6cf43 Modified Files -------------- src/backend/storage/ipc/standby.c | 34 ++++++++-- src/test/recovery/t/031_recovery_conflict.pl | 99 +++++++++++++++++++++++++++- 2 files changed, 128 insertions(+), 5 deletions(-)
