Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal
Fujii Masao <masao.fujii@oss.nttdata.com>
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2024-07-03T14:08:48Z
Lists: pgsql-hackers
Attachments
- v1-0001-Prevent-summarize_wal-from-enabling-when-wal_leve.patch (text/plain) patch v1-0001
Hi,
The documentation states that "WAL summarization cannot be enabled when wal_level is set to minimal." Therefore, at startup, the postmaster checks these settings and exits with an error if they are not configured properly.
However, I found that summarize_wal can still be enabled while the server is running with wal_level=minimal. Please see the following example to cause this situation. I think this is a bug.
=# SHOW wal_level;
wal_level
-----------
minimal
(1 row)
=# SELECT * FROM pg_get_wal_summarizer_state();
summarized_tli | summarized_lsn | pending_lsn | summarizer_pid
----------------+----------------+-------------+----------------
0 | 0/0 | 0/0 | (null)
(1 row)
=# ALTER SYSTEM SET summarize_wal TO on;
ALTER SYSTEM
=# SELECT pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)
=# SELECT * FROM pg_get_wal_summarizer_state();
summarized_tli | summarized_lsn | pending_lsn | summarizer_pid
----------------+----------------+-------------+----------------
1 | 0/1492D80 | 0/1492DF8 | 12228
(1 row)
The attached patch adds a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal, fixing the issue.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Commits
-
Do not summarize WAL if generated with wal_level=minimal.
- 2b5819e2b4d6 17.0 landed
- 402b586d0a9c 18.0 landed
-
Revert "Auto-tune effective_cache size to be 4x shared buffers"
- a16d421ca4fc 9.4.0 cited
-
Un-break ecpg test suite under --disable-integer-datetimes.
- 08c8e8962f56 9.4.0 cited
-
Again fix initialization of auto-tuned effective_cache_size.
- af930e606a32 9.4.0 cited
-
Code review for auto-tuned effective_cache_size.
- 285089696199 9.4.0 cited
-
Auto-tune effective_cache size to be 4x shared buffers
- ee1e5662d8d8 9.4.0 cited