From b98ac467f5d35970edade4ad65c767fc89059026 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Wed, 23 Mar 2011 13:30:05 +0000 Subject: [PATCH] Prevent intermittent hang in recovery from bgwriter interaction. Startup process waited for cleanup lock but when hot_standby = off the pid was not registered, so that the bgwriter would not wake the waiting process as intended. --- src/backend/access/transam/xlog.c | 2 ++ src/backend/storage/ipc/standby.c | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 306ac058c3..5a585f60d0 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -49,6 +49,7 @@ #include "storage/latch.h" #include "storage/pmsignal.h" #include "storage/predicate.h" +#include "storage/proc.h" #include "storage/procarray.h" #include "storage/reinit.h" #include "storage/smgr.h" @@ -6406,6 +6407,7 @@ StartupXLOG(void) */ if (InArchiveRecovery && IsUnderPostmaster) { + PublishStartupProcessInformation(); SetForwardFsyncRequests(); SendPostmasterSignal(PMSIGNAL_RECOVERY_STARTED); bgwriterLaunched = true; diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c index a92ae4af59..2e71484126 100644 --- a/src/backend/storage/ipc/standby.c +++ b/src/backend/storage/ipc/standby.c @@ -68,11 +68,6 @@ InitRecoveryTransactionEnvironment(void) */ SharedInvalBackendInit(true); - /* - * Record the PID and PGPROC structure of the startup process. - */ - PublishStartupProcessInformation(); - /* * Lock a virtual transaction id for Startup process. *