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

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Error "initial slot snapshot too large" in create replication slot
Date: 2021-10-19 08:55:07
Message-ID: CAFiTN-sVLdkdBzJFr2+b9iPvQ_MfWYQ2mhDAXP=cpbmyw-evNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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. Another issue is
that the total xids could be GetMaxSnapshotSubxidCount()
+GetMaxSnapshotXidCount().

I think what we should be doing is that if the xid is know subxid then
add in the snap->subxip array otherwise in snap->xip array. So
snap->xip array size will be GetMaxSnapshotXidCount() whereas the
snap->subxip array size will be GetMaxSnapshotSubxidCount(). And if
the array size is full then we can stop adding the subxids to the
array.

What is your thought on this?

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2021-10-19 09:12:46 Re: UPDATE on Domain Array that is based on a composite key crashes
Previous Message Kyotaro Horiguchi 2021-10-19 08:34:22 Re: [PATCH] Prefer getenv("HOME") to find the UNIX home directory