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

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

  1. Do not summarize WAL if generated with wal_level=minimal.

  2. Revert "Auto-tune effective_cache size to be 4x shared buffers"

  3. Un-break ecpg test suite under --disable-integer-datetimes.

  4. Again fix initialization of auto-tuned effective_cache_size.

  5. Code review for auto-tuned effective_cache_size.

  6. Auto-tune effective_cache size to be 4x shared buffers