From e76c1a0f4d2127f11c72c02b3d73a5dcb4517173 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 3 Jul 2010 20:43:58 +0000 Subject: Replace max_standby_delay with two parameters, max_standby_archive_delay and max_standby_streaming_delay, and revise the implementation to avoid assuming that timestamps found in WAL records can meaningfully be compared to clock time on the standby server. Instead, the delay limits are compared to the elapsed time since we last obtained a new WAL segment from archive or since we were last "caught up" to WAL data arriving via streaming replication. This avoids problems with clock skew between primary and standby, as well as other corner cases that the original coding would misbehave in, such as the primary server having significant idle time between transactions. Per my complaint some time ago and considerable ensuing discussion. Do some desultory editing on the hot standby documentation, too. --- src/backend/utils/misc/postgresql.conf.sample | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/backend/utils/misc/postgresql.conf.sample') diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 5ea568a355..e765664ecc 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -186,15 +186,19 @@ # - Streaming Replication - #max_wal_senders = 0 # max number of walsender processes -#wal_sender_delay = 200ms # 1-10000 milliseconds +#wal_sender_delay = 200ms # walsender cycle time, 1-10000 milliseconds #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables # - Standby Servers - -#hot_standby = off # allows queries during recovery -#max_standby_delay = 30s # max acceptable lag to allow queries to - # complete without conflict; -1 means forever -#vacuum_defer_cleanup_age = 0 # num transactions by which cleanup is deferred +#hot_standby = off # "on" allows queries during recovery +#max_standby_archive_delay = 30s # max delay before canceling queries + # when reading WAL from archive; + # -1 allows indefinite delay +#max_standby_streaming_delay = 30s # max delay before canceling queries + # when reading streaming WAL; + # -1 allows indefinite delay +#vacuum_defer_cleanup_age = 0 # number of transactions by which cleanup is deferred #------------------------------------------------------------------------------ -- cgit v1.2.1