public inbox for [email protected]
help / color / mirror / Atom feedFrom: Alexander Korotkov <[email protected]>
To: Hayato Kuroda (Fujitsu) <[email protected]>
Cc: Dilip Kumar <[email protected]>
Cc: Zhijie Hou (Fujitsu) <[email protected]>
Cc: Amit Kapila <[email protected]>
Cc: Vitaly Davydov <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Alexander Lakhin <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: Masahiko Sawada <[email protected]>
Cc: [email protected] <[email protected]>
Cc: vignesh C <[email protected]>
Subject: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
Date: Thu, 26 Jun 2025 17:48:45 +0300
Message-ID: <CAPpHfdvW1Cbo65UfWcO2uUCXnWosavL9f_UbNRAecTQH4o_RDA@mail.gmail.com> (raw)
In-Reply-To: <OSCPR01MB14966C00587EEA20AA28718F1F57AA@OSCPR01MB14966.jpnprd01.prod.outlook.com>
References: <OS0PR01MB5716BB506AF934376FF3A8BB947BA@OS0PR01MB5716.jpnprd01.prod.outlook.com>
<CAFiTN-uGkrCDi9kqXJqLB+3ATn_ZULmRER73VhkLSDSAnO8SNg@mail.gmail.com>
<OSCPR01MB149660EB8A874AC3AE777C658F57BA@OSCPR01MB14966.jpnprd01.prod.outlook.com>
<CAFiTN-uiVOGwPNmDBPmLnC-86hX9-pKEYH2D_OKUmJd5RAUv=g@mail.gmail.com>
<CAPpHfdsbjXd_iXQwOTS3iioyEmuNz3HdQG8E8tHB0LodN=RXLQ@mail.gmail.com>
<OSCPR01MB14966C00587EEA20AA28718F1F57AA@OSCPR01MB14966.jpnprd01.prod.outlook.com>
Dear Kuroda-san,
On Thu, Jun 26, 2025 at 6:46 AM Hayato Kuroda (Fujitsu)
<[email protected]> wrote:
>
> Dear Alexander,
> >
> > Good idea. But I think we should associate the "updated" flag
> > directly to the fact that one slot (no matter logical or physical)
> > changed its last_saved_restart_lsn. See the attached patch. I'm
> > going to push it if no objections.
>
> + /*
> + * Track if we're going to update slot's last_saved_restart_lsn.
> + * We need this to know if we need to recompute the required LSN.
> + */
> + if (s->last_saved_restart_lsn != s->data.restart_lsn)
> + last_saved_restart_lsn_updated = true;
>
> I feel no need to set to true if last_saved_restart_lsn_updated is already true.
> Other than that it's OK for me.
Thank you for your feedback.
Regarding last_saved_restart_lsn_updated, I think the opposite. I
think we should check if last_saved_restart_lsn_updated is set already
only if it could promise us some economy of resources. In our case
the main check only compares two fields of slot. And that fields are
to be accessed anyway. So, we are not going to save any RAM accesses.
Therefore, checking for last_saved_restart_lsn_updated seems like
unnecessary code complication (and I don't see we're doing that in
other places). So, I'm going to push this patch "as is".
------
Regards,
Alexander Korotkov
Supabase
view thread (73+ messages) latest in thread
reply
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
In-Reply-To: <CAPpHfdvW1Cbo65UfWcO2uUCXnWosavL9f_UbNRAecTQH4o_RDA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox