Re: pgsql: Implement pg_wal_replay_wait() stored procedure

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Implement pg_wal_replay_wait() stored procedure
Date: 2024-10-20 17:21:50
Message-ID: CAPpHfdut8AvtU9PhXBOd0r5LPYkLyPeiWS+sfZ0FRoUBrS3_TQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, Oct 16, 2024 at 11:20 PM Alexander Korotkov
<aekorotkov(at)gmail(dot)com> wrote:
>
> On Wed, Oct 16, 2024 at 10:35 PM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
> > On 02.09.24 01:55, Alexander Korotkov wrote:
> > > On Mon, Sep 2, 2024 at 2:28 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> > >> On Sun, Sep 01, 2024 at 10:35:27PM +0300, Alexander Korotkov wrote:
> > >>> This path hasn't changes since the patch revision when it was a
> > >>> utility command. I agree that this doesn't look like proper path for
> > >>> stored procedure. But I don't think src/backend/utils/adt is
> > >>> appropriate path either, because it's not really about data type.
> > >>> pg_wal_replay_wait() looks a good neighbor for
> > >>> pg_wal_replay_pause()/pg_wal_replay_resume() and other WAL-related
> > >>> functions. So, what about moving it to src/backend/access/transam?
> > >>
> > >> Moving the new function to xlogfuncs.c while publishing
> > >> WaitForLSNReplay() makes sense to me.
> > >
> > > Thank you for proposal. I like this.
> > >
> > > Could you, please, check the attached patch?
> >
> > We still have stuff in src/backend/commands/waitlsn.c that is nothing
> > like a "command". You have moved some stuff elsewhere, but what are you
> > planning to do with the rest?
>
> Thank you for spotting this another time. What about moving that
> somewhere like src/backend/access/transam/xlogwait.c ?

Implemented this as a separate patch (0001). Also rebased other
pending patches on that. 0004 now revises header comment of
xlogwait.c with new procedure signature.

------
Regards,
Alexander Korotkov
Supabase

Attachment Content-Type Size
v5-0002-Make-WaitForLSNReplay-issue-FATAL-on-postmaster-d.patch application/octet-stream 1.6 KB
v5-0001-Move-LSN-waiting-declarations-and-definitions-to-.patch application/octet-stream 8.6 KB
v5-0003-Refactor-WaitForLSNReplay-to-return-the-result-of.patch application/octet-stream 5.7 KB
v5-0004-Add-no_error-argument-to-pg_wal_replay_wait.patch application/octet-stream 10.5 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2024-10-21 02:11:50 pgsql: injection_points: Add basic isolation test
Previous Message Álvaro Herrera 2024-10-20 13:50:22 pgsql: Note that index_name in ALTER INDEX ATTACH PARTITION can be sche

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2024-10-20 17:36:13 Re: type cache cleanup improvements
Previous Message Tom Lane 2024-10-20 17:13:31 Re: Using Expanded Objects other than Arrays from plpgsql