This commit adds GUC log_recovery_conflict_waits that controls whether a log message is produced when the startup process is waiting longer than deadlock_timeout for recovery conflicts. This is useful in determining if recovery conflicts prevent the recovery from applying WAL.
Note that currently a log message is produced only when recovery conflict has not been resolved yet even after deadlock_timeout passes, i.e., only when the startup process is still waiting for recovery conflict even after deadlock_timeout.
Author: Bertrand Drouvot, Masahiko Sawada
0650ff2303 Add GUC to log long wait times on recovery conflicts.
doc/src/sgml/config.sgml | 22 +++
doc/src/sgml/high-availability.sgml | 6 +
src/backend/storage/buffer/bufmgr.c | 30 ++++
src/backend/storage/ipc/standby.c | 199 ++++++++++++++++++++++----
src/backend/storage/lmgr/proc.c | 48 ++++++-
src/backend/utils/misc/guc.c | 10 +-
src/backend/utils/misc/postgresql.conf.sample | 2 +
src/include/storage/standby.h | 5 +-
8 files changed, 292 insertions(+), 30 deletions(-)