max_standby_streaming_delay
当热备处于活动状态时,此参数确定备库在取消与即将应用的 WAL 条目冲突的备库查询之前应等待多长时间,如第 26.4.2 节中所述。max_standby_streaming_delay 在通过物理流复制接收 WAL 数据时应用。如果未指定单位,则将其视为毫秒。默认值为 30 秒。值为-1 允许备库永远等待冲突查询完成。此参数只能在 postgresql.conf 文件或服务器命令行中设置。 注意,max_standby_streaming_delay 并不等同于查询在被取消前可以运行的最长时间;它表示从主库接收到 WAL 数据后,允许用于应用这些数据的最长总时间。因此,如果某个查询已造成显著延迟,后续冲突查询的宽限时间就会短得多,直到备库再次赶上进度。
英文手册覆盖始于 PostgreSQL 7.4. 来源历史与运行验证各自保留独立版本边界。
当前阅读 PG 19·选择有来源记录的版本
- boot val
- 30000
- category
- Replication / Standby Servers
- context
- sighup
- doc same as
- 未知
- documented
- true
- enumvals
- 未知
- extra desc
- -1 means wait forever.
- lang
- en
- max val
- 2147483647
- metadata version
- 19beta4
- min val
- -1
- name
- max_standby_streaming_delay
- short desc
- Sets the maximum delay before canceling queries when a hot standby server is processing streamed WAL data.
- source
- pg-settings-source-snapshot
- unit
- ms
- vartype
- integer
版本定义 PG 19
当热备处于活动状态时,此参数确定备库在取消与即将应用的 WAL 条目冲突的备库查询之前应等待多长时间,如第 26.4.2 节中所述。max_standby_streaming_delay 在通过物理流复制接收 WAL 数据时应用。如果未指定单位,则将其视为毫秒。默认值为 30 秒。值为-1 允许备库永远等待冲突查询完成。此参数只能在 postgresql.conf 文件或服务器命令行中设置。
注意,max_standby_streaming_delay 并不等同于查询在被取消前可以运行的最长时间;它表示从主库接收到 WAL 数据后,允许用于应用这些数据的最长总时间。因此,如果某个查询已造成显著延迟,后续冲突查询的宽限时间就会短得多,直到备库再次赶上进度。
比较版本
完整来源事实
doc html
<p>
When hot standby is active, this parameter determines how long the
standby server should wait before canceling standby queries that
conflict with about-to-be-applied WAL entries, as described in
<a class="xref" href="/docs/19/hot-standby.html#HOT-STANDBY-CONFLICT" title="26.4.2. Handling Query Conflicts">Section 26.4.2</a>.
<code class="varname">max_standby_streaming_delay</code> applies when WAL data is
being received via streaming physical replication.
If this value is specified without units, it is taken as milliseconds.
The default is 30 seconds.
A value of -1 allows the standby to wait forever for conflicting
queries to complete.
This parameter can only be set in the <code class="filename">postgresql.conf</code>
file or on the server command line.
</p><p>
Note that <code class="varname">max_standby_streaming_delay</code> is not the same as
the maximum length of time a query can run before cancellation; rather
it is the maximum total time allowed to apply WAL data once it has
been received from the primary server. Thus, if one query has
resulted in significant delay, subsequent conflicting queries will
have much less grace time until the standby server has caught up
again.
</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"}来源引用
定义来源
center · PostgreSQL 19 · wiki-repair-20261023:02bfa9c7df7ca101088741124467733c689d350c36a3e07123299a881d62418b
正文语言: zh-Hans · wiki-repair-20261023:02bfa9c7df7ca101088741124467733c689d350c36a3e07123299a881d62418b