Wiki / Configuration Parameters
wal_sender_shutdown_timeout
Specifies the maximum time the server waits during shutdown for all WAL data to be replicated to the receiver. If this value is specified without units, it is taken as milliseconds. A value of -1 (the default) disables the timeout mechanism, allowing the WAL sender to wait as long as necessary for the receiver to catch up. A value of 0 causes the WAL sender to terminate without waiting for the receiver to catch up. 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 to zero or a positive 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. Care should be taken to select a value high enough to allow all WAL data to be replicated to the receiver under normal circumstances. This parameter can be set in primary_conninfo and in the CONNECTION clause of CREATE SUBSCRIPTION (for example, include options=-cwal_sender_shutdown_timeout=10s in the connection string), allowing different timeouts per replication connection. For example, when both physical and logical replication are used, it can be disabled for physical replication (e.g., for switchovers) while enabled for logical replication to limit shutdown time.
English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.
Reading PG 19·Select a recorded version
- boot val
- -1
- category
- Replication / Sending Servers
- context
- user
- doc same as
- Unknown
- documented
- true
- enumvals
- Unknown
- extra desc
- -1 means wait indefinitely. 0 means do not wait.
- lang
- en
- max val
- 2147483647
- metadata version
- 19beta4
- min val
- -1
- name
- wal_sender_shutdown_timeout
- short desc
- Sets the maximum time the server waits during shutdown for all WAL data to be replicated to the receiver.
- source
- pg-settings-source-snapshot
- unit
- ms
- vartype
- integer
Definition PG 19
Specifies the maximum time the server waits during shutdown for all
WAL data to be replicated to the receiver. If this value is specified
without units, it is taken as milliseconds. A value of
-1 (the default) disables the timeout mechanism,
allowing the WAL sender to wait as long as necessary for the receiver
to catch up. A value of 0 causes the WAL sender to
terminate without waiting for the receiver to catch up.
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 to zero or a positive 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. Care should be taken to select a value high enough to allow all WAL data to be replicated to the receiver under normal circumstances.
This parameter can be set in primary_conninfo and
in the CONNECTION clause of
CREATE SUBSCRIPTION (for example, include
options=-cwal_sender_shutdown_timeout=10s in the
connection string), allowing different timeouts per replication
connection. For example, when both physical and logical replication
are used, it can be disabled for physical replication (e.g., for
switchovers) while enabled for logical replication to limit shutdown
time.
Compare versions
Complete source facts
doc html
<p>
Specifies the maximum time the server waits during shutdown for all
WAL data to be replicated to the receiver. If this value is specified
without units, it is taken as milliseconds. A value of
<code class="literal">-1</code> (the default) disables the timeout mechanism,
allowing the WAL sender to wait as long as necessary for the receiver
to catch up. A value of <code class="literal">0</code> causes the WAL sender to
terminate without waiting for the receiver to catch up.
</p><p>
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.
</p><p>
If this parameter is set to zero or a positive 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. Care should be taken to
select a value high enough to allow all WAL data to be replicated to
the receiver under normal circumstances.
</p><p>
This parameter can be set in <code class="varname">primary_conninfo</code> and
in the <code class="literal">CONNECTION</code> clause of
<code class="command">CREATE SUBSCRIPTION</code> (for example, include
<code class="literal">options=-cwal_sender_shutdown_timeout=10s</code> in the
connection string), allowing different timeouts per replication
connection. For example, when both physical and logical replication
are used, it can be disabled for physical replication (e.g., for
switchovers) while enabled for logical replication to limit shutdown
time.
</p>documentation revision
{"inputs":[{"file":"runtime-config-replication.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"76b3c1615af7dd60d031cefd485568e6336b3d13c366e8a473304bd7ef2fb92d","version":"19rc2"},{"file":"runtime-config-replication.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"935f29b71e863329c3c39caae902de37d5bbf03c2adcf42322225d3cefe71a84","version":"19rc2"}],"release":"19rc2","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"}Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 19 · wiki-repair-20261023:e79c425094f8350a583033eb1b9c68a55b1f70ddb700fdbb2d2687af196ed218
Text language: en · wiki-repair-20261023:e79c425094f8350a583033eb1b9c68a55b1f70ddb700fdbb2d2687af196ed218