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: Robert Haas <robertmhaas@gmail.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>, pgsql-hackers@lists.postgresql.org
Date: 2024-07-15T18:47:14Z
Lists: pgsql-hackers
On Mon, Jul 15, 2024 at 02:30:42PM -0400, Robert Haas wrote: > On Sun, Jul 14, 2024 at 10:56 PM Fujii Masao > <masao.fujii@oss.nttdata.com> wrote: >> I don't think it's a rare scenario since summarize_wal can be enabled >> after starting the server with wal_level=minimal. Therefore, I believe >> such a configuration should be prohibited using a GUC check hook, >> as my patch does. > > I guess I'm in the group of people who doesn't understand how this can > possibly work. There's no guarantee about the order in which GUC check > hooks are called, so you don't know if the value of the other variable > has already been set to the final value or not, which seems like a > fatal problem even if the code happens to work correctly as of today. > Even if you have such a guarantee, you can't prohibit a configuration > change at pg_ctl reload time: the server can refuse to start in case > of an invalid configuration, but a running server can't decide to shut > down or stop working at reload time. My understanding is that the correctness of this GUC check hook depends on wal_level being a PGC_POSTMASTER GUC. The check hook would always return true during startup, and there'd be an additional cross-check in PostmasterMain() that would fail startup if necessary. After that point, we know that wal_level cannot change, so the GUC check hook for summarize_wal can depend on wal_level. If it fails, my expectation would be that the server would just ignore that change and continue. -- 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