Re: Wrong assert in TransactionGroupUpdateXidStatus

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Wrong assert in TransactionGroupUpdateXidStatus
Date: 2019-12-13 02:23:27
Message-ID: CAA4eK1+E5uKMcds_kJ_3zq5RzswnDA9q8QLdD-AF7mBktoWBVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 12, 2019 at 8:44 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Tue, Dec 10, 2019 at 4:32 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> > and then, within an if():
> >
> > /*
> > * We don't try to do group update optimization if a process has
> > * overflowed the subxids array in its PGPROC, since in that case we
> > * don't have a complete list of XIDs for it.
> > */
> > Assert(THRESHOLD_SUBTRANS_CLOG_OPT <= PGPROC_MAX_CACHED_SUBXIDS);
> >
> > Even if these weren't redundant, it can't make sense to test such a
> > static condition only within an if? Is it possible this was actually
> > intended to test something different?
>
> Based on the comment, I imagine it might've been intended to read
> Assert(nsubxids <= PGPROC_MAX_CACHED_SUBXIDS).
>

Do you think we need such an Assert after having StaticAssert for
(THRESHOLD_SUBTRANS_CLOG_OPT <= PGPROC_MAX_CACHED_SUBXIDS) and then
an if statement containing (nsubxids <= THRESHOLD_SUBTRANS_CLOG_OPT)
just before this Assert? Sure, we can keep this for extra safety, but
I don't see the need for it.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2019-12-13 02:49:26 Re: shared tempfile was not removed on statement_timeout (unreproducible)
Previous Message Peter Geoghegan 2019-12-13 02:21:20 Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.