Re: [HACKERS] Block level parallel vacuum - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: [HACKERS] Block level parallel vacuum
Date
Msg-id CAFiTN-sq_+-pwLGjynp7CQeaUfeeCK++t8H+7FxHTE9ocF9c_w@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Block level parallel vacuum  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Tue, Jan 21, 2020 at 2:46 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Tue, Jan 21, 2020 at 12:51 PM Masahiko Sawada
> <masahiko.sawada@2ndquadrant.com> wrote:
> >
> > On Tue, 21 Jan 2020 at 16:13, Amit Kapila <amit.kapila16@gmail.com> wrote:
> > >
> > > SizeOfLVDeadTuplesHeader is not defined by patch.  Do you think it
> > > makes sense to add a comment here about the calculation?
> >
> > Oops, it should be SizeOfLVDeadTuples. Attached updated version.
> >
> > I defined two macros: SizeOfLVDeadTuples is the size of LVDeadTuples
> > struct and SizeOfDeadTuples is the size including LVDeadTuples struct
> > and dead tuples.
> >
>
> I have reproduced the issue by defining MaxAllocSize as 10240000 and
> then during debugging, skipped the check related to LAZY_ALLOC_TUPLES.
> After patch, it fixes the problem for me.  I have slightly modified
> your patch to define the macros on the lines of existing macros
> TXID_SNAPSHOT_SIZE and TXID_SNAPSHOT_MAX_NXIP.  What do you think
> about it?
>
> Andres, see if you get a chance to run the test again with the
> attached patch, otherwise, I will commit it tomorrow morning.
>
Patch looks fine to me except, we better use parentheses for the
variable passed in macro.

+#define MAXDEADTUPLES(max_size) \
+ ((max_size - offsetof(LVDeadTuples, itemptrs)) / sizeof(ItemPointerData))
change to -> (((max_size) - offsetof(LVDeadTuples, itemptrs)) /
sizeof(ItemPointerData))

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



pgsql-hackers by date:

Previous
From: Juan José Santamaría Flecha
Date:
Subject: Re: [PATCH] Windows port, fix some resources leaks
Next
From: Luis Carril
Date:
Subject: Re: Option to dump foreign data in pg_dump