Re: Error "initial slot snapshot too large" in create replication slot

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: dilipbalaut(at)gmail(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Error "initial slot snapshot too large" in create replication slot
Date: 2022-01-31 05:31:58
Message-ID: 20220131.143158.896330709668373625.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 2 Nov 2021 16:40:39 +0530, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote in
> On Tue, Oct 19, 2021 at 2:25 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> >
> > On Tue, Oct 12, 2021 at 11:30 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> > >
> > > On Tue, Oct 12, 2021 at 10:35 AM Kyotaro Horiguchi
> > > <horikyota(dot)ntt(at)gmail(dot)com> wrote:
> > > >
> > > > At Tue, 12 Oct 2021 13:59:59 +0900 (JST), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in
> > > > > So I came up with the attached version.
> > > >
> > > > Sorry, it was losing a piece of change.
> > >
> > > Yeah, at a high level this is on the idea I have in mind, I will do a
> > > detailed review in a day or two. Thanks for working on this.
> >
> > While doing the detailed review, I think there are a couple of
> > problems with the patch, the main problem of storing all the xid in
> > the snap->subxip is that once we mark the snapshot overflown then the
> > XidInMVCCSnapshot, will not search the subxip array, instead it will
> > fetch the topXid and search in the snap->xip array.
>
> I missed that you are marking the snapshot as takenDuringRecovery so
> your fix looks fine.
>
> Another issue is
> > that the total xids could be GetMaxSnapshotSubxidCount()
> > +GetMaxSnapshotXidCount().
> >
>
> I have fixed this, the updated patch is attached.

Mmm. The size of the array cannot be larger than the numbers the
*Connt() functions return. Thus we cannot attach the oversized array
to ->subxip. (I don't recall clearly but that would lead to assertion
failure somewhere..)

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-01-31 05:34:16 Re: Spelling change in LLVM 14 API
Previous Message Dilip Kumar 2022-01-31 05:29:33 Re: Make relfile tombstone files conditional on WAL level