Re: 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: Robert Haas <robertmhaas@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2024-07-11T10:51:20Z
Lists: pgsql-hackers
On 2024/07/11 1:35, Robert Haas wrote: > On Wed, Jul 10, 2024 at 10:10 AM Robert Haas <robertmhaas@gmail.com> wrote: >> On Wed, Jul 10, 2024 at 1:56 AM Fujii Masao <masao.fujii@oss.nttdata.com> wrote: >>> I believe this issue occurs when the server is shut down cleanly. >>> The shutdown-checkpoint record retains the wal_level value used >>> before the shutdown. If wal_level is changed after this, >>> the wal_level that indicated by the shutdown-checkpoint record >>> and that the WAL data generated afterwards depends on may not match. >> >> Oh, that's a problem. I'll have to think about that. > > Here is an attempt at fixing this problem. Thanks for updating the patch! + * fast_forward is normally false, but is true when we have encountered + * WAL generated with wal_level=minimal and are skipping over it without + * emitting summary files. In this case, summarized_tli and summarized_lsn + * will advance even though nothing is being written to disk, until we + * again reach a point where wal_level>minimal. + * * summarizer_pgprocno is the proc number of the summarizer process, if * one is running, or else INVALID_PROC_NUMBER. * @@ -83,6 +89,7 @@ typedef struct TimeLineID summarized_tli; XLogRecPtr summarized_lsn; bool lsn_is_exact; + bool fast_forward; It looks like the fast_forward field in WalSummarizerData is no longer necessary. So far, I haven't found any other issues with the patch. 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