]> granicus.if.org Git - postgresql/commit
Fix walsender to exit promptly if client requests shutdown.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Jun 2017 16:00:03 +0000 (12:00 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Jun 2017 16:00:03 +0000 (12:00 -0400)
commite9d4aa594f2caa8c28d55c41c9926420b1efdb79
tree6182eb19cbc83c2dccd770cca4a67900499a4e7b
parent43c67e32fb2920233e680af7a7e979ebb762c7e8
Fix walsender to exit promptly if client requests shutdown.

It's possible for WalSndWaitForWal to be asked to wait for WAL that doesn't
exist yet.  That's fine, in fact it's the normal situation if we're caught
up; but when the client requests shutdown we should not keep waiting.
The previous coding could wait indefinitely if the source server was idle.

In passing, improve the rather weak comments in this area, and slightly
rearrange some related code for better readability.

Back-patch to 9.4 where this code was introduced.

Discussion: https://postgr.es/m/14154.1498781234@sss.pgh.pa.us
src/backend/replication/walsender.c