Re: Assertion failure in update_local_synced_slot(), slotsync.c:364

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Zhijie Hou <houzhijie22(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assertion failure in update_local_synced_slot(), slotsync.c:364
Date: 2026-11-16 05:00:54
Message-ID: CAA4eK1KOVG0gX6afA1XRWC_CPG8X0xUh=EnBga=zd5ozB1cewA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 14, 2026 at 12:11 PM Bertrand Drouvot
<bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
>
> On Sat, Nov 14, 2026 at 09:04:57AM +0530, Amit Kapila wrote:
> > On Fri, Nov 13, 2026 at 7:29 PM Bertrand Drouvot
> > <bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
> >
> > Right the reason can remain as SS_SKIP_WAL_OR_ROWS_REMOVED. Even in
> > the first cycle, the reason could be either SS_SKIP_WAL_NOT_FLUSHED or
> > SS_SKIP_WAL_OR_ROWS_REMOVED and in that case also the caller
>
> Oh right, I missed SS_SKIP_WAL_NOT_FLUSHED.
>
> > update_and_persist_local_synced_slot() won't persist the slot. So, I
> > don't see a problem with retaining the previous reason when we didn't
> > perform anything in a particular sync cycle.
>
> Right, but once the WAL has been flushed or the remote slot has caught up,
> retaining SS_SKIP_WAL_NOT_FLUSHED or SS_SKIP_WAL_OR_ROWS_REMOVED would make
> slotsync_skip_reason report a misleading reason: the slot remains temporary
> because it still has no consistent snapshot.
>

Fair enough, so we can update the skip_reason as the latest patch from
Hou-San does but we should add a DEBUG1 or LOG level message like we
do in other cases in the same function. How about something on the
following line:
ereport(DEBUG1,
errmsg("could not synchronize
replication slot \"%s\"",
remote_slot->name),
errdetail("The standby has not yet
reached a consistent "
"point when decoding
WAL from LSN %X/%08X, and "
"the remote slot has
not advanced since the "
"last attempt.",

LSN_FORMAT_ARGS(slot->data.restart_lsn)));

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ayush Tiwari 2026-11-16 05:26:45 Re: 041_checkpoint_at_promote.pl might fail due to race condition on child kill
Previous Message Henson Choi 2026-11-16 05:00:53 [DEPARSE] Columns added to a function's result type shift its column aliases