Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
Date
Msg-id CAPpHfdsbjXd_iXQwOTS3iioyEmuNz3HdQG8E8tHB0LodN=RXLQ@mail.gmail.com
Whole thread Raw
In response to RE: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly  ("Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>)
Responses RE: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
List pgsql-hackers
On Wed, Jun 25, 2025 at 11:25 AM Dilip Kumar <dilipbalaut@gmail.com> wrote:
> On Wed, Jun 25, 2025 at 1:18 PM Hayato Kuroda (Fujitsu)
> <kuroda.hayato@fujitsu.com> wrote:
> > Another idea is to call ReplicationSlotsComputeRequiredLSN() when at least one
> > of the restart_lsn is updated, like attached. I feel this could reduce the computation
> > bit more.
>
> Right, that makes sense, if there is nothing updated on disk then we
> can avoid computing this.

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.

------
Regards,
Alexander Korotkov
Supabase

Attachment

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Making Row Comparison NULL row member handling more robust during skip scans
Next
From: Michael Paquier
Date:
Subject: Re: Decompression bug in astreamer_lz4