Re: Clear logical slot's 'synced' flag on promotion of standby - Mailing list pgsql-hackers

From shveta malik
Subject Re: Clear logical slot's 'synced' flag on promotion of standby
Date
Msg-id CAJpy0uAMJYWbZio2rLPjBKzLzHFucqK3mP3UA1+sLcL+ujxbUQ@mail.gmail.com
Whole thread Raw
In response to Re: Clear logical slot's 'synced' flag on promotion of standby  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Responses Re: Clear logical slot's 'synced' flag on promotion of standby
List pgsql-hackers
On Tue, Sep 23, 2025 at 6:41 PM Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
>
> > 3)
> > + ereport(LOG,
> > + (errmsg("reset synced flag for replication slot \"%s\"",
> > + NameStr(s->data.name))));
> >
> > a) Shall we change it to DEBUG1?
> > b) Shall the msg be:
> > synced flag reset for replication slot \"%s\" during promotion
> >
>
> I think this can stay as a LOG message, it only runs once at startup
> and applies just to logical slots, so it won’t be noisy.

It does not run at startup, it runs during promotion. Having said
that, if there are a lot many slots, and we have one message per slot,
overall logs can still be more. I somehow find DEBUG better here. But
we can leave it as LOG and can revisit later when others review.

> I’d also
> avoid mentioning “during promotion,” since the flag might accidentally
> be set on the primary and then reset later during startup, making that
> description inaccurate.

This function is called only during promotion (see check 'if
(promoted)') and thus the suggested message ( “during promotion")
seems better to me.

Ajin, we can add comments atop ResetSyncedSlots() that this function
is invoked/used only during promotion, making the usage more clear.

thanks
Shveta



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: [PATCH] Hex-coding optimizations using SVE on ARM.
Next
From: shveta malik
Date:
Subject: Re: Report bytes and transactions actually sent downtream