From 6f60fdd7015b032bf49273c99f80913d57eac284 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 11 Oct 2012 17:39:52 +0300 Subject: 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. --- doc/src/sgml/config.sgml | 36 ++++++++++++++++++++++-------------- doc/src/sgml/release-9.1.sgml | 2 +- 2 files changed, 23 insertions(+), 15 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 83884164305..b4fcbaf9c7d 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -2236,10 +2236,10 @@ include 'filename' - - replication_timeout (integer) + + wal_sender_timeout (integer) - replication_timeout configuration parameter + wal_sender_timeout configuration parameter @@ -2251,12 +2251,6 @@ include 'filename' the postgresql.conf file or on the server command line. The default value is 60 seconds. - - To prevent connections from being terminated prematurely, - - must be enabled on the standby, and its value must be less than the - value of replication_timeout. - @@ -2474,11 +2468,6 @@ include 'filename' the postgresql.conf file or on the server command line. The default value is 10 seconds. - - When is enabled on a sending server, - wal_receiver_status_interval must be enabled, and its value - must be less than the value of replication_timeout. - @@ -2507,6 +2496,25 @@ include 'filename' + + wal_receiver_timeout (integer) + + wal_receiver_timeout configuration parameter + + + + Terminate replication connections that are inactive longer + than the specified number of milliseconds. This is useful for + the receiving standby server to detect a primary node crash or network + outage. + A value of zero disables the timeout mechanism. This parameter + can only be set in + the postgresql.conf file or on the server command line. + The default value is 60 seconds. + + + + diff --git a/doc/src/sgml/release-9.1.sgml b/doc/src/sgml/release-9.1.sgml index 6bc1c8c90eb..5fbdd7a1952 100644 --- a/doc/src/sgml/release-9.1.sgml +++ b/doc/src/sgml/release-9.1.sgml @@ -3322,7 +3322,7 @@ Add - replication_timeout + replication_timeout setting (Fujii Masao, Heikki Linnakangas) -- cgit v1.2.3