Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal
Date: 2024-07-11 10:51:20
Message-ID: e2549085-5246-4edc-bc62-ae19df48acc5@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024/07/11 1:35, Robert Haas wrote:
> On Wed, Jul 10, 2024 at 10:10 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> On Wed, Jul 10, 2024 at 1:56 AM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message cca5507 2024-07-11 11:05:48 Re: Fix a comment error in logicalrep_write_typ()
Previous Message Alastair Turner 2024-07-11 10:47:45 Re: Send duration output to separate log files