From 9bb1ddec4cd998c5fbac278a54d8ad5a5011e4e1 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Wed, 23 Mar 2011 13:32:37 +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 bb06a2e016..4e4ec1cb9a 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -47,6 +47,7 @@ #include "storage/fd.h" #include "storage/ipc.h" #include "storage/pmsignal.h" +#include "storage/proc.h" #include "storage/procarray.h" #include "storage/smgr.h" #include "storage/spin.h" @@ -6135,6 +6136,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 8ddfa60b38..ce02fe7604 100644 --- a/src/backend/storage/ipc/standby.c +++ b/src/backend/storage/ipc/standby.c @@ -70,11 +70,6 @@ InitRecoveryTransactionEnvironment(void) SharedInvalBackendInit(true); /* - * Record the PID and PGPROC structure of the startup process. - */ - PublishStartupProcessInformation(); - - /* * Lock a virtual transaction id for Startup process. * * We need to do GetNextLocalTransactionId() because -- 2.11.0