From: Nathan Bossart <nathandbossart@gmail.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal
Date: Wed, 3 Jul 2024 09:29:50 -0500
Message-ID: <ZoVgXuYWbzTLXyRY@nathan> (raw)
In-Reply-To: <6e30082e-041b-4e31-9633-95a66de76f5d@oss.nttdata.com>
References: <6e30082e-041b-4e31-9633-95a66de76f5d@oss.nttdata.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, masao.fujii@oss.nttdata.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal
In-Reply-To: <ZoVgXuYWbzTLXyRY@nathan>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox