Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2024-07-03T14:29:50Z
Lists: pgsql-hackers
On Wed, Jul 03, 2024 at 11:08:48PM +0900, Fujii Masao wrote:
> +/*
> + * GUC check_hook for summarize_wal
> + */
> +bool
> +check_summarize_wal(bool *newval, void **extra, GucSource source)
> +{
> + if (*newval && wal_level == WAL_LEVEL_MINIMAL)
> + {
> + GUC_check_errmsg("WAL cannot be summarized when \"wal_level\" is \"minimal\"");
> + return false;
> + }
> + return true;
> +}
IME these sorts of GUC hooks that depend on the value of other GUCs tend to
be quite fragile. This one might be okay because wal_level defaults to
'replica' and because there is an additional check in postmaster.c, but
that at least deserves a comment.
This sort of thing comes up enough that perhaps we should add a
better-supported way to deal with GUCs that depend on each other...
--
nathan
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