Thread: pgsql: Improve replication connection timeouts.

pgsql: Improve replication connection timeouts.

From
Heikki Linnakangas
Date:
Improve replication connection timeouts.

Rename replication_timeout to wal_sender_timeout, and add a new setting
called wal_receiver_timeout that does the same at the walreceiver side.
There was previously no timeout in walreceiver, so if the network went down,
for example, the walreceiver could take a long time to notice that the
connection was lost. Now with the two settings, both sides of a replication
connection will detect a broken connection similarly.

It is no longer necessary to manually set wal_receiver_status_interval to
a value smaller than the timeout. Both wal sender and receiver now
automatically send a "ping" message if more than 1/2 of the configured
timeout has elapsed, and it hasn't received any messages from the other end.

Amit Kapila, heavily edited by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/6f60fdd7015b032bf49273c99f80913d57eac284

Modified Files
--------------
doc/src/sgml/config.sgml                      |   36 ++++++----
doc/src/sgml/release-9.1.sgml                 |    2 +-
src/backend/replication/walreceiver.c         |   94 +++++++++++++++++++++----
src/backend/replication/walsender.c           |   88 +++++++++++++++---------
src/backend/utils/misc/guc.c                  |   15 ++++-
src/backend/utils/misc/postgresql.conf.sample |    5 +-
src/include/replication/walprotocol.h         |   12 +++
src/include/replication/walreceiver.h         |    2 +
src/include/replication/walsender.h           |    2 +-
src/include/replication/walsender_private.h   |    1 -
10 files changed, 190 insertions(+), 67 deletions(-)