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:
parent
856a23018c
commit
b98ac467f5
|
@ -49,6 +49,7 @@
|
||||||
#include "storage/latch.h"
|
#include "storage/latch.h"
|
||||||
#include "storage/pmsignal.h"
|
#include "storage/pmsignal.h"
|
||||||
#include "storage/predicate.h"
|
#include "storage/predicate.h"
|
||||||
|
#include "storage/proc.h"
|
||||||
#include "storage/procarray.h"
|
#include "storage/procarray.h"
|
||||||
#include "storage/reinit.h"
|
#include "storage/reinit.h"
|
||||||
#include "storage/smgr.h"
|
#include "storage/smgr.h"
|
||||||
|
@ -6406,6 +6407,7 @@ StartupXLOG(void)
|
||||||
*/
|
*/
|
||||||
if (InArchiveRecovery && IsUnderPostmaster)
|
if (InArchiveRecovery && IsUnderPostmaster)
|
||||||
{
|
{
|
||||||
|
PublishStartupProcessInformation();
|
||||||
SetForwardFsyncRequests();
|
SetForwardFsyncRequests();
|
||||||
SendPostmasterSignal(PMSIGNAL_RECOVERY_STARTED);
|
SendPostmasterSignal(PMSIGNAL_RECOVERY_STARTED);
|
||||||
bgwriterLaunched = true;
|
bgwriterLaunched = true;
|
||||||
|
|
|
@ -68,11 +68,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.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue