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_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b589f6182fac7c22cc16ab694f8823b426331016

Modified Files
--------------
src/backend/storage/ipc/standby.c            |  34 +++++++--
src/test/recovery/t/031_recovery_conflict.pl | 102 ++++++++++++++++++++++++++-
2 files changed, 130 insertions(+), 6 deletions(-)

Reply via email to