From 178311692a2cab384b80a920f0a8adf7f36078b8 Mon Sep 17 00:00:00 2001 From: "Chao Li (Evan)" Date: Fri, 17 Jul 2026 13:24:08 +0800 Subject: [PATCH v1] doc: Clarify wal_sender_shutdown_timeout behavior for small values Document that nonnegative values enable the timeout and that zero causes the WAL sender to terminate without waiting for the receiver to catch up. Also caution against values too small to allow catch-up, especially for physical replication. While here, fix nearby indentation and add blank lines between paragraphs. Author: Chao Li --- doc/src/sgml/config.sgml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index aa7b1bd75d2..b7c462e0f26 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -4990,21 +4990,28 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows without units, it is taken as milliseconds. A value of -1 (the default) disables the timeout mechanism. + - When replication is in use, the sending server normally waits until - all WAL data has been transferred to the receiver before completing - shutdown. This helps keep sender and receiver in sync after shutdown, - which is especially important for physical replication switchovers, - but it can delay shutdown. + When replication is in use, the sending server normally waits until + all WAL data has been transferred to the receiver before completing + shutdown. This helps keep sender and receiver in sync after shutdown, + which is especially important for physical replication switchovers, + but it can delay shutdown. + - If this parameter is set, the server stops waiting and completes - shutdown when the timeout expires. This can shorten shutdown time, - for example, when replication is slow on high-latency networks or - when a logical replication apply worker is blocked waiting for locks. - However, in this case the sender and receiver may be out of sync after - shutdown. + If this parameter is set to a nonnegative value, the server stops + waiting and completes shutdown when the timeout expires. This can + shorten shutdown time, for example, when replication is slow on + high-latency networks or when a logical replication apply worker is + blocked waiting for locks. However, in this case the sender and + receiver may be out of sync after shutdown. In particular, a value of + 0 causes the WAL sender to terminate without waiting + for the receiver to catch up. Therefore, 0 or a + value too small to allow the receiver to catch up should be used with + caution, especially for physical replication. + This parameter can be set in primary_conninfo and in the CONNECTION clause of -- 2.50.1 (Apple Git-155)