aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/checkpointer.c2
-rw-r--r--src/backend/postmaster/postmaster.c6
-rw-r--r--src/backend/replication/syncrep.c10
3 files changed, 8 insertions, 10 deletions
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c
index 178db7dba36..c9473f7bad7 100644
--- a/src/backend/postmaster/checkpointer.c
+++ b/src/backend/postmaster/checkpointer.c
@@ -673,7 +673,7 @@ CheckpointWriteDelay(int flags, double progress)
got_SIGHUP = false;
ProcessConfigFile(PGC_SIGHUP);
/* update global shmem state for sync rep */
- SyncRepUpdateSyncStandbysDefined();
+ UpdateSharedMemoryConfig();
}
AbsorbFsyncRequests();
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 9d242cbfcb7..05db29cb93b 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -4212,13 +4212,13 @@ sigusr1_handler(SIGNAL_ARGS)
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;
}
diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c
index 81b1fb4e8d4..8977327c8c6 100644
--- a/src/backend/replication/syncrep.c
+++ b/src/backend/replication/syncrep.c
@@ -62,9 +62,6 @@ char *SyncRepStandbyNames;
#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;
@@ -98,6 +95,7 @@ SyncRepWaitForLSN(XLogRecPtr XactCommitLSN)
{
char *new_status = NULL;
const char *old_status;
+ int mode = SyncRepWaitMode;
/*
* Fast exit if user has not requested sync replication, or there are no
@@ -122,7 +120,7 @@ SyncRepWaitForLSN(XLogRecPtr XactCommitLSN)
* be a low cost check.
*/
if (!WalSndCtl->sync_standbys_defined ||
- XLByteLE(XactCommitLSN, WalSndCtl->lsn[SyncRepWaitMode]))
+ XLByteLE(XactCommitLSN, WalSndCtl->lsn[mode]))
{
LWLockRelease(SyncRepLock);
return;
@@ -134,8 +132,8 @@ SyncRepWaitForLSN(XLogRecPtr XactCommitLSN)
*/
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. */