Re: Synchronizing slots from primary to standby - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Synchronizing slots from primary to standby
Date
Msg-id Zg+AdK3+MU6SSDLv@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Synchronizing slots from primary to standby  (shveta malik <shveta.malik@gmail.com>)
Responses Re: Synchronizing slots from primary to standby
List pgsql-hackers
Hi,

On Fri, Apr 05, 2024 at 09:43:35AM +0530, shveta malik wrote:
> On Fri, Apr 5, 2024 at 9:22 AM Bertrand Drouvot
> <bertranddrouvot.pg@gmail.com> wrote:
> >
> > Hi,
> >
> > On Thu, Apr 04, 2024 at 05:31:45PM +0530, shveta malik wrote:
> > > On Thu, Apr 4, 2024 at 2:59 PM shveta malik <shveta.malik@gmail.com> wrote:
> > 2 ===
> >
> > +                       if (slot->data.confirmed_flush != remote_slot->confirmed_lsn)
> > +                               elog(LOG,
> > +                                        "could not synchronize local slot \"%s\" LSN(%X/%X)"
> > +                                        " to remote slot's LSN(%X/%X) ",
> > +                                        remote_slot->name,
> > +                                        LSN_FORMAT_ARGS(slot->data.confirmed_flush),
> > +                                        LSN_FORMAT_ARGS(remote_slot->confirmed_lsn));
> >
> > I don't think that the message is correct here. Unless I am missing something
> > there is nothing in the following code path that would prevent the slot to be
> > sync during this cycle.
> 
> This is a sanity check,  I will put a comment to indicate the same.

Thanks!

> We
> want to ensure if anything changes in future, we get correct logs to
> indicate that.

Right, understood that way.

> If required, the LOG msg can be changed. Kindly suggest if you have
> anything better in mind.
> 

What about something like?

ereport(LOG,
        errmsg("synchronized confirmed_flush_lsn for slot \"%s\" differs from remote slot",
        remote_slot->name),
        errdetail("Remote slot has LSN %X/%X but local slot has LSN %X/%X.",
        LSN_FORMAT_ARGS(remote_slot->restart_lsn),
        LSN_FORMAT_ARGS(slot->data.restart_lsn));

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Statistics Import and Export
Next
From: shveta malik
Date:
Subject: Re: promotion related handling in pg_sync_replication_slots()