FatalError = false;
/*
- * Crank up the background writer. It doesn't matter if this fails,
+ * Crank up the background writers. It doesn't matter if this fails,
* we'll just try again later.
*/
- Assert(BgWriterPID == 0);
- BgWriterPID = StartBackgroundWriter();
Assert(CheckpointerPID == 0);
CheckpointerPID = StartCheckpointer();
+ Assert(BgWriterPID == 0);
+ BgWriterPID = StartBackgroundWriter();
pmState = PM_RECOVERY;
}
#define SyncStandbysDefined() \
(SyncRepStandbyNames != NULL && SyncRepStandbyNames[0] != '\0')
-#define SyncRepRequested() \
- (max_wal_senders > 0 && synchronous_commit > SYNCHRONOUS_COMMIT_LOCAL_FLUSH)
-
static bool announce_next_takeover = true;
static int SyncRepWaitMode = SYNC_REP_NO_WAIT;
{
char *new_status = NULL;
const char *old_status;
+ int mode = SyncRepWaitMode;
/*
* Fast exit if user has not requested sync replication, or there are no
* be a low cost check.
*/
if (!WalSndCtl->sync_standbys_defined ||
- XLByteLE(XactCommitLSN, WalSndCtl->lsn[SyncRepWaitMode]))
+ XLByteLE(XactCommitLSN, WalSndCtl->lsn[mode]))
{
LWLockRelease(SyncRepLock);
return;
*/
MyProc->waitLSN = XactCommitLSN;
MyProc->syncRepState = SYNC_REP_WAITING;
- SyncRepQueueInsert(SyncRepWaitMode);
- Assert(SyncRepQueueIsOrderedByLSN(SyncRepWaitMode));
+ SyncRepQueueInsert(mode);
+ Assert(SyncRepQueueIsOrderedByLSN(mode));
LWLockRelease(SyncRepLock);
/* Alter ps display to show waiting for sync rep. */