wal_debug

用于发出WAL调试输出的系统参数

wal_debug 是一个用于发出与WAL相关的调试信息的配置参数

wal_debug 添加于PostgreSQL 7.1

用法

wal_debug 是一个开发者GUC,只有在编译PostgreSQL时在src/include/pg_config_manual.h中定义了宏WAL_DEBUG时才可用。

默认值

wal_debug 的默认值为:off

变更历史

示例

在可用实例上启用wal_debug时的日志输出

[2022-06-09 08:52:57 UTC] psql postgres postgres LOG:  00000: statement: ALTER SYSTEM SET wal_debug = on;
[2022-06-09 08:52:57 UTC] psql postgres postgres LOCATION:  exec_simple_query, postgres.c:1053
[2022-06-09 08:52:59 UTC] psql postgres postgres LOG:  00000: statement: SELECT pg_reload_conf();
[2022-06-09 08:52:59 UTC] psql postgres postgres LOCATION:  exec_simple_query, postgres.c:1053
[2022-06-09 08:52:59 UTC]    LOG:  00000: received SIGHUP, reloading configuration files
[2022-06-09 08:52:59 UTC]    LOCATION:  SIGHUP_handler, postmaster.c:2763
[2022-06-09 08:52:59 UTC]    LOG:  00000: parameter "wal_debug" changed to "on"
[2022-06-09 08:52:59 UTC]    LOCATION:  ProcessConfigFileInternal, guc-file.l:455

后续日志输出将包含广泛的WAL调试信息,例如:

[2022-06-09 08:53:29 UTC]    LOG:  00000: INSERT @ 0/3000868:  - XLOG/FPI_FOR_HINT:
[2022-06-09 08:53:29 UTC]    LOCATION:  XLogInsertRecord, xlog.c:1000
[2022-06-09 08:53:29 UTC]    LOG:  00000: INSERT @ 0/3000DF8:  - XLOG/FPI_FOR_HINT:
[2022-06-09 08:53:29 UTC]    LOCATION:  XLogInsertRecord, xlog.c:1000
[2022-06-09 08:53:29 UTC]    LOG:  00000: INSERT @ 0/3000E50:  - Heap2/PRUNE: latestRemovedXid 0 nredirected 2 ndead 3
[2022-06-09 08:53:29 UTC]    LOCATION:  XLogInsertRecord, xlog.c:1000

尝试在编译时未设置WAL_DEBUG宏的实例上使用wal_debug

postgres=# SHOW wal_debug;
ERROR:  unrecognized configuration parameter "wal_debug"

分类

开发/测试GUC配置项WAL

参见

wal_consistency_checking

反馈

提交关于"wal_debug"的任何评论、建议或更正 在此