diff options
| author | Magnus Hagander | 2012-06-11 13:07:55 +0000 |
|---|---|---|
| committer | Magnus Hagander | 2012-06-11 13:17:38 +0000 |
| commit | 3595a71e9ce90a2d4c812a9bb34dc24ffc492c2b (patch) | |
| tree | 03ea44f4a86401fc35be03d44843206ae0bd2aa7 | |
| parent | 9af34cdec87d8e60f200ccd5b1b695880412c62b (diff) | |
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
| -rw-r--r-- | src/backend/replication/syncrep.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c index a2ae8700d1..a3319642c6 100644 --- a/src/backend/replication/syncrep.c +++ b/src/backend/replication/syncrep.c @@ -397,6 +397,7 @@ SyncRepReleaseWaiters(void) volatile WalSnd *walsnd = &walsndctl->walsnds[i]; if (walsnd->pid != 0 && + walsnd->state == WALSNDSTATE_STREAMING && walsnd->sync_standby_priority > 0 && (priority == 0 || priority > walsnd->sync_standby_priority)) |
