Fix bug in clean shutdown of walsender that pg_receiving is connecting to.

Fujii Masao <fujii@postgresql.org>

Commit: 5c6d9fc4b2b8b6688a482a4b4116d7642e36b9d9
Author: Fujii Masao <fujii@postgresql.org>
Date: 2014-03-17T11:37:50Z
Releases: 9.4.0
Fix bug in clean shutdown of walsender that pg_receiving is connecting to.

On clean shutdown, walsender waits for all WAL to be replicated to a standby,
and exits. It determined whether that replication had been completed by
checking whether its sent location had been equal to a standby's flush
location. Unfortunately this condition never becomes true when the standby
such as pg_receivexlog which always returns an invalid flush location is
connecting to walsender, and then walsender waits forever.

This commit changes walsender so that it just checks a standby's write
location if a flush location is invalid.

Back-patch to 9.1 where enough infrastructure for this exists.

Files

PathChange+/−
src/backend/replication/walsender.c modified +11 −1