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

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: andres(at)anarazel(dot)de
Cc: jchampion(at)timescale(dot)com, y(dot)sokolov(at)postgrespro(dot)ru, dilipbalaut(at)gmail(dot)com, rjuju123(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Error "initial slot snapshot too large" in create replication slot
Date: 2022-09-13 08:31:05
Message-ID: 20220913.173105.1366509818461708829.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 13 Sep 2022 16:15:34 +0900 (JST), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in
> At Tue, 13 Sep 2022 15:45:07 +0900 (JST), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in
> > At Mon, 12 Sep 2022 14:51:56 -0700, Andres Freund <andres(at)anarazel(dot)de> wrote in
> > > This sees a tad misleading - the previous snapshot wasn't borken, right?
> >
> > I saw it kind of broken that ->xip contains sub transactions. But I
> > didn't meant it's broken by "correct". Is "proper" suitable there?
>
> No. It's not broken if it is takenDuringRecovery. So this flag can be
> used to notify that xip can be oversized.
>
> I realized that rbtxn_is_known_subxact is not reliable. I'm
> redirecting to oversized xip. Pleas wait for a while.

However, the reader of saved snapshots (ImportSnapshot) has the
restriction that

> if (xcnt < 0 || xcnt > GetMaxSnapshotXidCount())
> ereport(ERROR,

and

> if (xcnt < 0 || xcnt > GetMaxSnapshotSubxidCount())
> ereport(ERROR,
(this xid is subxcnt)

And ExportSnapshot repalces oversized subxip with overflowed.

So even when GetSnapshotData() returns a snapshot with oversized
subxip, it is saved as just "overflowed" on exporting. I don't think
this is the expected behavior since such (no xip and overflowed)
snapshot no longer works.

On the other hand, it seems to me that snapbuild doesn't like
takenDuringRecovery snapshots.

So snapshot needs additional flag signals that xip is oversized and
all xid are holded there. And also need to let takenDuringRecovery
suggest subxip is oversized.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2022-09-13 08:43:22 Re: Fix broken link to FreeBSD DocProj in docs
Previous Message David Rowley 2022-09-13 08:27:39 Re: Reducing the chunk header sizes on all memory context types