Skip to content

Commit 48c9f49

Browse files
Fix race condition when changing synchronous_standby_names
A momentary window exists when synchronous_standby_names changes that allows commands issued after the change to continue to act as async until the change becomes visible. Remove the race by using more appropriate test in syncrep.c Author: Asim Rama Praveen and Ashwin Agrawal Reported-by: Xin Zhang, Ashwin Agrawal, and Asim Rama Praveen Reviewed-by: Michael Paquier, Masahiko Sawada
1 parent 2958a67 commit 48c9f49

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/backend/replication/syncrep.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,9 @@ SyncRepWaitForLSN(XLogRecPtr lsn, bool commit)
156156
mode = Min(SyncRepWaitMode, SYNC_REP_WAIT_FLUSH);
157157

158158
/*
159-
* Fast exit if user has not requested sync replication, or there are no
160-
* sync replication standby names defined. Note that those standbys don't
161-
* need to be connected.
159+
* Fast exit if user has not requested sync replication.
162160
*/
163-
if (!SyncRepRequested() || !SyncStandbysDefined())
161+
if (!SyncRepRequested())
164162
return;
165163

166164
Assert(SHMQueueIsDetached(&(MyProc->syncRepLinks)));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy