Re: Assertion failure in SnapBuildInitialSnapshot()

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Pradeep Kumar <spradeepkumar29(at)gmail(dot)com>, Alexander Lakhin <exclusion(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, vignesh C <vignesh21(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Assertion failure in SnapBuildInitialSnapshot()
Date: 2025-11-06 10:36:38
Message-ID: CAA4eK1KcA=DrC3NTifig-x5DPXaxDEMLSZSz9gWS16m_d-+6rQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 6, 2025 at 12:03 PM Zhijie Hou (Fujitsu)
<houzj(dot)fnst(at)fujitsu(dot)com> wrote:
>
> On Thursday, October 30, 2025 7:01 AM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> >
> >
> > Also, I think it's worth considering the idea Robert shared before[1]:
> >
> > ---
> > But what about just surgically preventing that?
> > ProcArraySetReplicationSlotXmin() could refuse to retreat the values,
> > perhaps? If it computes an older value than what's there, it just does nothing?
> > ---
> >
> > We did a similar fix for confirmed_flush LSN by commit ad5eaf390c582, and it
> > sounds reasonable to me that ProcArraySetReplicationSlotXmin() refuses to
> > retreat the values.
>
> I reviewed the thread and think that we could not straightforwardly apply a
> similar strategy to prevent the retreat of xmin/catalog_xmin here. This is
> because we maintain a central value
> (replication_slot_xmin/replication_slot_catalog_xmin) in
> ProcArraySetReplicationSlotXmin, where the value is expected to decrease when
> certain slots are dropped or invalidated.
>

Good point. This can happen when the last slot is invalidated or dropped.

>
Therefore, I think we might need to
> continue with the original proposal to invert the lock and also address the code
> path for slotsync.
>

+1.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-11-06 10:37:32 Re: Logical Replication of sequences
Previous Message Álvaro Herrera 2025-11-06 10:31:38 Re: Use stack-allocated StringInfoData