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

2024-01-16 Thread Robert Haas
On Mon, Jan 15, 2024 at 9:18 PM Kyotaro Horiguchi wrote: > Thank you for the deep insights. I have understood your points. As I > can't think of any further simple modifications on this line, I will > withdraw this CF entry. At the moment, I also lack a fundamental, > comprehensive solution, but

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

2024-01-15 Thread Kyotaro Horiguchi
At Fri, 12 Jan 2024 11:28:09 -0500, Robert Haas wrote in > However, I wonder whether this whole area is in need of a bigger > rethink. There seem to be a number of situations in which the split > into xip and subxip arrays is not very convenient, and also some > situations where it's quite

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

2024-01-12 Thread Robert Haas
On Thu, Jan 11, 2024 at 9:47 PM Kyotaro Horiguchi wrote: > I understand. So, summirizing the current state briefly, I believe it > as follows: > > a. snapbuild lacks a means to differentiate between top and sub xids > during snapshot building. > > b. Abusing takenDuringRecovery could lead to

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

2024-01-11 Thread Kyotaro Horiguchi
Thank you for the comments. This will help move the discussion forward. At Fri, 5 Jan 2024 15:17:11 -0500, Robert Haas wrote in > On Thu, Mar 23, 2023 at 11:02 PM Kyotaro Horiguchi > wrote: > > [ new patch ] > > Well, I guess nobody is too excited about fixing this, because it's > been

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

2024-01-11 Thread vignesh C
On Sat, 6 Jan 2024 at 01:47, Robert Haas wrote: > > On Thu, Mar 23, 2023 at 11:02 PM Kyotaro Horiguchi > wrote: > > [ new patch ] > > Well, I guess nobody is too excited about fixing this, because it's > been another 10 months with no discussion. Andres doesn't even seem to > think this is as

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

2024-01-05 Thread Robert Haas
On Thu, Mar 23, 2023 at 11:02 PM Kyotaro Horiguchi wrote: > [ new patch ] Well, I guess nobody is too excited about fixing this, because it's been another 10 months with no discussion. Andres doesn't even seem to think this is as much a bug as it is a limitation, for all that it's filed in the

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

2023-03-23 Thread Kyotaro Horiguchi
Thanks for looking this! At Thu, 23 Mar 2023 14:15:12 +0530, Dilip Kumar wrote in > On Thu, Mar 23, 2023 at 10:53 AM Kyotaro Horiguchi > wrote: > Thanks for working on this, your idea looks fine but my only worry is > that in the future if someone tries to change the logic of >

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

2023-03-23 Thread Dilip Kumar
On Thu, Mar 23, 2023 at 10:53 AM Kyotaro Horiguchi wrote: > > At Wed, 22 Mar 2023 14:27:40 +0900 (JST), Kyotaro Horiguchi > wrote in > > At Mon, 20 Mar 2023 13:46:51 -0400, "Gregory Stark (as CFM)" > > wrote in > > > Kyotoro Horiguchi, any chance you'll be able to work on this for this > > >

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

2023-03-22 Thread Kyotaro Horiguchi
At Wed, 22 Mar 2023 14:27:40 +0900 (JST), Kyotaro Horiguchi wrote in > At Mon, 20 Mar 2023 13:46:51 -0400, "Gregory Stark (as CFM)" > wrote in > > Kyotoro Horiguchi, any chance you'll be able to work on this for this > > commitfest? If so shout (or anyone else is planning to push it over > >

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

2023-03-21 Thread Kyotaro Horiguchi
At Mon, 20 Mar 2023 13:46:51 -0400, "Gregory Stark (as CFM)" wrote in > On Wed, 12 Oct 2022 at 01:10, Michael Paquier wrote: > > The discussion seems to have stopped here. As this is classified as a > > bug fix, I have moved this patch to next CF, waiting on author for the > > moment. > >

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

2023-03-20 Thread Gregory Stark (as CFM)
On Wed, 12 Oct 2022 at 01:10, Michael Paquier wrote: > > On Tue, Sep 13, 2022 at 05:31:05PM +0900, Kyotaro Horiguchi wrote: > > And ExportSnapshot repalces oversized subxip with overflowed. > > > > So even when GetSnapshotData() returns a snapshot with oversized > > subxip, it is saved as just

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

2023-02-02 Thread Andres Freund
Hi, On 2022-10-12 14:10:15 +0900, Michael Paquier wrote: > The discussion seems to have stopped here. As this is classified as a > bug fix, I have moved this patch to next CF, waiting on author for the > moment. FWIW, I view this more as lifting a limitation. I wouldn't want to backpatch the

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

2022-10-11 Thread Michael Paquier
On Tue, Sep 13, 2022 at 05:31:05PM +0900, Kyotaro Horiguchi wrote: > 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

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

2022-09-13 Thread Kyotaro Horiguchi
At Tue, 13 Sep 2022 16:15:34 +0900 (JST), Kyotaro Horiguchi wrote in > At Tue, 13 Sep 2022 15:45:07 +0900 (JST), Kyotaro Horiguchi > wrote in > > At Mon, 12 Sep 2022 14:51:56 -0700, Andres Freund > > wrote in > > > This sees a tad misleading - the previous snapshot wasn't borken, right? >

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

2022-09-13 Thread Kyotaro Horiguchi
Sigh.. At Tue, 13 Sep 2022 16:30:06 +0900 (JST), Kyotaro Horiguchi wrote in > It is possible that the subxip is overrun. We need to expand the array > somehow. Or assign the array of the size (GetMaxSnapshotXidCount() + > GetMaxSnapshotSubxidCount()) for takenDuringRecovery snapshots. And I

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

2022-09-13 Thread Kyotaro Horiguchi
At Tue, 13 Sep 2022 16:10:59 +0900 (JST), Kyotaro Horiguchi wrote in > At Tue, 13 Sep 2022 12:08:18 +0530, Dilip Kumar wrote > in > > On Tue, Sep 13, 2022 at 11:52 AM Kyotaro Horiguchi > > wrote: > > > That function is called after the SnapBuild reaches > > > SNAPBUILD_CONSISTENT state ,or

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

2022-09-13 Thread Kyotaro Horiguchi
At Tue, 13 Sep 2022 15:45:07 +0900 (JST), Kyotaro Horiguchi wrote in > At Mon, 12 Sep 2022 14:51:56 -0700, Andres Freund 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

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

2022-09-13 Thread Kyotaro Horiguchi
At Tue, 13 Sep 2022 12:08:18 +0530, Dilip Kumar wrote in > On Tue, Sep 13, 2022 at 11:52 AM Kyotaro Horiguchi > wrote: > > That function is called after the SnapBuild reaches > > SNAPBUILD_CONSISTENT state ,or SnapBuildInitialSnapshot() rejects > > other than that state. That is, IIUC the

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

2022-09-13 Thread Kyotaro Horiguchi
At Mon, 12 Sep 2022 14:51:56 -0700, Andres Freund wrote in > Hi, > > Thanks for working on this! > > > I think this should include a test that fails without this change and succeeds > with it... > > > On 2022-07-19 11:55:06 +0900, Kyotaro Horiguchi wrote: > > From

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

2022-09-13 Thread Dilip Kumar
On Tue, Sep 13, 2022 at 11:52 AM Kyotaro Horiguchi wrote: > > Thanks for raizing this up, Robert and the comment, Andres. > > At Tue, 13 Sep 2022 07:00:42 +0530, Dilip Kumar wrote > in > > On Tue, Sep 13, 2022 at 3:22 AM Andres Freund wrote: > > > > > > > > It's not obvious to me that it's the

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

2022-09-13 Thread Kyotaro Horiguchi
Thanks for raizing this up, Robert and the comment, Andres. At Tue, 13 Sep 2022 07:00:42 +0530, Dilip Kumar wrote in > On Tue, Sep 13, 2022 at 3:22 AM Andres Freund wrote: > > > > > It's not obvious to me that it's the right design (or even correct) to ask > > reorderbuffer about an xid

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

2022-09-12 Thread Dilip Kumar
On Tue, Sep 13, 2022 at 3:22 AM Andres Freund wrote: > > It's not obvious to me that it's the right design (or even correct) to ask > reorderbuffer about an xid being a subxid. Maybe I'm missing something, but > why would reorderbuffer even be guaranteed to know about all these subxids? Yeah,

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

2022-09-12 Thread Andres Freund
Hi, On 2022-09-09 13:19:14 -0400, Robert Haas wrote: > I mentioned this patch to Andres in conversation, and he expressed a > concern that there might be no guarantee that we retain enough CLOG to > look up XIDs. I was concerned we wouldn't keep enough subtrans, rather than clog. But I think

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

2022-09-12 Thread Andres Freund
Hi, Thanks for working on this! I think this should include a test that fails without this change and succeeds with it... On 2022-07-19 11:55:06 +0900, Kyotaro Horiguchi wrote: > From abcf0a0e0b3e2de9927d8943a3e3c145ab189508 Mon Sep 17 00:00:00 2001 > From: Kyotaro Horiguchi > Date: Tue, 19

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

2022-09-09 Thread Robert Haas
On Mon, Jul 18, 2022 at 10:55 PM Kyotaro Horiguchi wrote: > Thanks! Just rebased. Hi, I mentioned this patch to Andres in conversation, and he expressed a concern that there might be no guarantee that we retain enough CLOG to look up XIDs. Presumably this wouldn't be an issue when the snapshot

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

2022-07-18 Thread Kyotaro Horiguchi
At Tue, 5 Jul 2022 11:32:42 -0700, Jacob Champion wrote in > On Thu, Mar 31, 2022 at 11:53 PM Kyotaro Horiguchi > wrote: > > So this is that. v5 creates a regular snapshot. > > This patch will need a quick rebase over 905c020bef9, which added > `extern` to several missing locations. Thanks!

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

2022-07-05 Thread Jacob Champion
On Thu, Mar 31, 2022 at 11:53 PM Kyotaro Horiguchi wrote: > So this is that. v5 creates a regular snapshot. This patch will need a quick rebase over 905c020bef9, which added `extern` to several missing locations. Thanks, --Jacob

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

2022-04-01 Thread Kyotaro Horiguchi
At Fri, 01 Apr 2022 14:44:30 +0900 (JST), Kyotaro Horiguchi wrote in > At Sun, 13 Feb 2022 17:35:38 +0300, Yura Sokolov > wrote in > > And there are checks for `takenDuringRecovery` in `heapgetpage` and > > `heapam_scan_sample_next_tuple`. Are this checks affected by the change? > > Neither

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

2022-03-31 Thread Kyotaro Horiguchi
At Sun, 13 Feb 2022 17:35:38 +0300, Yura Sokolov wrote in > В Пн, 07/02/2022 в 13:52 +0530, Dilip Kumar пишет: > > Right. I think the patch looks fine to me. > > > > Good day. > > I've looked to the patch. Personally I'd prefer dynamically resize > xip array. But I think there is issue with

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

2022-02-13 Thread Yura Sokolov
В Пн, 07/02/2022 в 13:52 +0530, Dilip Kumar пишет: > On Mon, Jan 31, 2022 at 11:50 AM Kyotaro Horiguchi > wrote: > > At Mon, 17 Jan 2022 09:27:14 +0530, Dilip Kumar > > wrote in > > > > me> Mmm. The size of the array cannot be larger than the numbers the > > me> *Connt() functions return.

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

2022-02-07 Thread Dilip Kumar
On Mon, Jan 31, 2022 at 11:50 AM Kyotaro Horiguchi wrote: > > At Mon, 17 Jan 2022 09:27:14 +0530, Dilip Kumar wrote > in > > me> Mmm. The size of the array cannot be larger than the numbers the > me> *Connt() functions return. Thus we cannot attach the oversized array > me> to ->subxip. (I

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

2022-01-30 Thread Dilip Kumar
On Mon, Jan 31, 2022 at 11:50 AM Kyotaro Horiguchi wrote: > > SnapBUildInitialSnapshot tries to store XIDS of both top and sub > transactions into snapshot->xip array but the array is easily > overflowed and CREATE_REPLICATOIN_SLOT command ends with an error. > > To fix this, this patch is doing

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

2022-01-30 Thread Kyotaro Horiguchi
At Mon, 17 Jan 2022 09:27:14 +0530, Dilip Kumar wrote in > On Wed, Jan 12, 2022 at 4:09 PM Julien Rouhaud wrote: > > The cfbot reports that this patch doesn't compile: > > https://cirrus-ci.com/task/564273490432?logs=build > > > > [03:01:24.477] snapbuild.c: In function

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

2022-01-30 Thread Kyotaro Horiguchi
At Tue, 2 Nov 2021 16:40:39 +0530, Dilip Kumar wrote in > On Tue, Oct 19, 2021 at 2:25 PM Dilip Kumar wrote: > > > > On Tue, Oct 12, 2021 at 11:30 AM Dilip Kumar wrote: > > > > > > On Tue, Oct 12, 2021 at 10:35 AM Kyotaro Horiguchi > > > wrote: > > > > > > > > At Tue, 12 Oct 2021 13:59:59

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

2022-01-16 Thread Dilip Kumar
On Wed, Jan 12, 2022 at 4:09 PM Julien Rouhaud wrote: > Hi, > > On Tue, Nov 02, 2021 at 04:40:39PM +0530, Dilip Kumar wrote: > > > > I have fixed this, the updated patch is attached. > > The cfbot reports that this patch doesn't compile: > https://cirrus-ci.com/task/564273490432?logs=build >

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

2022-01-12 Thread Julien Rouhaud
Hi, On Tue, Nov 02, 2021 at 04:40:39PM +0530, Dilip Kumar wrote: > > I have fixed this, the updated patch is attached. The cfbot reports that this patch doesn't compile: https://cirrus-ci.com/task/564273490432?logs=build [03:01:24.477] snapbuild.c: In function ‘SnapBuildInitialSnapshot’:

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

2021-11-02 Thread Dilip Kumar
On Tue, Oct 19, 2021 at 2:25 PM Dilip Kumar wrote: > > On Tue, Oct 12, 2021 at 11:30 AM Dilip Kumar wrote: > > > > On Tue, Oct 12, 2021 at 10:35 AM Kyotaro Horiguchi > > wrote: > > > > > > At Tue, 12 Oct 2021 13:59:59 +0900 (JST), Kyotaro Horiguchi > > > wrote in > > > > So I came up with the

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

2021-10-19 Thread Dilip Kumar
On Tue, Oct 12, 2021 at 11:30 AM Dilip Kumar wrote: > > On Tue, Oct 12, 2021 at 10:35 AM Kyotaro Horiguchi > wrote: > > > > At Tue, 12 Oct 2021 13:59:59 +0900 (JST), Kyotaro Horiguchi > > wrote in > > > So I came up with the attached version. > > > > Sorry, it was losing a piece of change. > >

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

2021-10-12 Thread Dilip Kumar
On Tue, Oct 12, 2021 at 10:35 AM Kyotaro Horiguchi wrote: > > At Tue, 12 Oct 2021 13:59:59 +0900 (JST), Kyotaro Horiguchi > 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

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

2021-10-11 Thread Kyotaro Horiguchi
At Tue, 12 Oct 2021 13:59:59 +0900 (JST), Kyotaro Horiguchi wrote in > So I came up with the attached version. Sorry, it was losing a piece of change. -- Kyotaro Horiguchi NTT Open Source Software Center >From 424f405b4c9d41471eae1edd48cdbb6a6d47217e Mon Sep 17 00:00:00 2001 From: Kyotaro

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

2021-10-11 Thread Kyotaro Horiguchi
At Mon, 11 Oct 2021 16:48:10 +0530, Dilip Kumar wrote in > On Mon, Oct 11, 2021 at 4:29 PM Kyotaro Horiguchi > wrote: > > > > At Mon, 11 Oct 2021 11:49:41 +0530, Dilip Kumar > > wrote in > > > While creating an "export snapshot" I don't see any protection why the > > > number of xids in the

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

2021-10-11 Thread Dilip Kumar
On Mon, Oct 11, 2021 at 4:29 PM Kyotaro Horiguchi wrote: > > At Mon, 11 Oct 2021 11:49:41 +0530, Dilip Kumar wrote > in > > While creating an "export snapshot" I don't see any protection why the > > number of xids in the snapshot can not cross the > > "GetMaxSnapshotXidCount()"?. > > > >

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

2021-10-11 Thread Kyotaro Horiguchi
At Mon, 11 Oct 2021 11:49:41 +0530, Dilip Kumar wrote in > While creating an "export snapshot" I don't see any protection why the > number of xids in the snapshot can not cross the > "GetMaxSnapshotXidCount()"?. > > Basically, while converting the HISTORIC snapshot to the MVCC snapshot > in

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

2021-10-11 Thread Dilip Kumar
While creating an "export snapshot" I don't see any protection why the number of xids in the snapshot can not cross the "GetMaxSnapshotXidCount()"?. Basically, while converting the HISTORIC snapshot to the MVCC snapshot in "SnapBuildInitialSnapshot()", we add all the xids between snap->xmin to