diff options
Diffstat (limited to 'src/backend/replication/syncrep.c')
-rw-r--r-- | src/backend/replication/syncrep.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c index 7fa1a87cd82..bdbc9ef844b 100644 --- a/src/backend/replication/syncrep.c +++ b/src/backend/replication/syncrep.c @@ -165,12 +165,11 @@ SyncRepWaitForLSN(XLogRecPtr lsn, bool commit) * Since this routine gets called every commit time, it's important to * exit quickly if sync replication is not requested. So we check * WalSndCtl->sync_standbys_defined flag without the lock and exit - * immediately if it's false. If it's true, we need to check it again later - * while holding the lock, to check the flag and operate the sync rep - * queue atomically. This is necessary to avoid the race condition - * described in SyncRepUpdateSyncStandbysDefined(). On the other - * hand, if it's false, the lock is not necessary because we don't touch - * the queue. + * immediately if it's false. If it's true, we need to check it again + * later while holding the lock, to check the flag and operate the sync + * rep queue atomically. This is necessary to avoid the race condition + * described in SyncRepUpdateSyncStandbysDefined(). On the other hand, if + * it's false, the lock is not necessary because we don't touch the queue. */ if (!SyncRepRequested() || !((volatile WalSndCtlData *) WalSndCtl)->sync_standbys_defined) @@ -426,7 +425,7 @@ SyncRepInitConfig(void) ereport(DEBUG1, (errmsg_internal("standby \"%s\" now has synchronous standby priority %u", - application_name, priority))); + application_name, priority))); } } |