Hi,

While reading the doc for wal_sender_shutdown_timeout, I felt that it does not 
explicitly describe the behavior of a value of 0. According to the 
implementation, when wal_sender_shutdown_timeout is 0, the WAL sender 
terminates without waiting for the receiver to catch up by calling 
WalSndDoneImmediate(). When the value is very small, such as 1 millisecond, the 
timeout expires shortly afterward if the receiver has not already caught up, so 
from a user's perspective, the behavior may be very similar to that of 0.

As I understand it, wal_sender_shutdown_timeout is intended to prevent shutdown 
from taking unexpectedly long. A value of 0 requests no waiting, while a value 
that is too small may provide insufficient time for the receiver to catch up. 
Such values should therefore be used with caution, especially for physical 
replication.

The attached patch clarifies that the timeout is enabled for nonnegative 
values, documents the behavior of 0, and cautions users against setting a value 
too small for the receiver to catch up.

While touching this part of the doc, I also noticed that the preceding 
paragraph was missing one level of indentation and that there was no blank line 
between paragraphs. I was previously advised that paragraphs should be 
separated by a blank line, so the patch fixes these formatting issues as well.

If accepted, this patch is intended for v19.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/




Attachment: v1-0001-doc-Clarify-wal_sender_shutdown_timeout-behavior-.patch
Description: Binary data

Reply via email to