1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-20 05:03:10 +03:00

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.
This commit is contained in:
Simon Riggs
2011-03-23 13:32:37 +00:00
parent 3cb2f2ae4c
commit 9bb1ddec4c
2 changed files with 2 additions and 5 deletions

View File

@ -47,6 +47,7 @@
#include "storage/fd.h" #include "storage/fd.h"
#include "storage/ipc.h" #include "storage/ipc.h"
#include "storage/pmsignal.h" #include "storage/pmsignal.h"
#include "storage/proc.h"
#include "storage/procarray.h" #include "storage/procarray.h"
#include "storage/smgr.h" #include "storage/smgr.h"
#include "storage/spin.h" #include "storage/spin.h"
@ -6135,6 +6136,7 @@ StartupXLOG(void)
*/ */
if (InArchiveRecovery && IsUnderPostmaster) if (InArchiveRecovery && IsUnderPostmaster)
{ {
PublishStartupProcessInformation();
SetForwardFsyncRequests(); SetForwardFsyncRequests();
SendPostmasterSignal(PMSIGNAL_RECOVERY_STARTED); SendPostmasterSignal(PMSIGNAL_RECOVERY_STARTED);
bgwriterLaunched = true; bgwriterLaunched = true;

View File

@ -69,11 +69,6 @@ InitRecoveryTransactionEnvironment(void)
*/ */
SharedInvalBackendInit(true); SharedInvalBackendInit(true);
/*
* Record the PID and PGPROC structure of the startup process.
*/
PublishStartupProcessInformation();
/* /*
* Lock a virtual transaction id for Startup process. * Lock a virtual transaction id for Startup process.
* *