RE: pg_logical_slot_get_changes waits continously for a partial WAL record spanning across 2 pages

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, 'Michael Paquier' <michael(at)paquier(dot)xyz>, vignesh C <vignesh21(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com>
Subject: RE: pg_logical_slot_get_changes waits continously for a partial WAL record spanning across 2 pages
Date: 2025-06-26 09:40:05
Message-ID: OSCPR01MB1496617B6F24EA85DE5D9D9D1F57AA@OSCPR01MB14966.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > Another reliable approach would be to make the
> > code wait before reading the record in the internal loop of
> > ReadPageInternal() with an injection point when we know that we have a
> > contrecord, but I'm not really excited about this prospect in
> > xlogreader.c which can be also used in the frontend.
>
> Per my understanding an injection point must be added while flushing a WAL
> record,
> to emulate the incomplete WAL record issue. To confirm, how can it be used in
> ReadPageInternal()?

I've spent time how we use the injection point to cause the same situation, which
generates the OVERWRITE_CONTRECORD in-between the page, but it seems difficult.

XLogFlush()->XLogWrite() has a responsibility to flush WAL records, but it does not
write/flush per pages. It tries to write to pages as much as possible and
flushes the result at once. A corner case is when the segment is changed, but
this is not the same situation we observed the failure.

So... I have no idea to create deterministic reproducers, it is OK for me to use
046 test for the purpose.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2025-06-26 09:47:33 Re: Suggestion to add --continue-client-on-abort option to pgbench
Previous Message Dmitry 2025-06-26 09:33:04 Re: IPC/MultixactCreation on the Standby server