Skip to content

Commit 3595a71

Browse files
committed
Prevent non-streaming replication connections from being selected sync slave
This prevents a pg_basebackup backup session that just does a base backup (no xlog involved at all) from becoming the synchronous slave and thus blocking all access while it runs. Also fixes the problem when a higher priority slave shows up it would become the sync standby before it has reached the STREAMING state, by making sure we can only switch to a walsender that's actually STREAMING. Fujii Masao
1 parent 9af34cd commit 3595a71

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/backend/replication/syncrep.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ SyncRepReleaseWaiters(void)
397397
volatile WalSnd *walsnd = &walsndctl->walsnds[i];
398398

399399
if (walsnd->pid != 0 &&
400+
walsnd->state == WALSNDSTATE_STREAMING &&
400401
walsnd->sync_standby_priority > 0 &&
401402
(priority == 0 ||
402403
priority > walsnd->sync_standby_priority))

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