Re: Bug in wait time when waiting on nested subtransaction

From: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in wait time when waiting on nested subtransaction
Date: 2022-11-29 12:53:02
Message-ID: CANbhV-GCPReVnHdQt_x38tDPrd1D86b3rS_BE5fLxeeO-j9Xkg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 28 Nov 2022 at 21:10, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Mon, Nov 28, 2022 at 3:01 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > One thing we need to be pretty careful of here is to not break the
> > promise of atomic commit. At topmost commit, all subxacts must
> > appear committed simultaneously. It's not quite clear to me whether
> > we need a similar guarantee in the rollback case. It seems like
> > we shouldn't, but maybe I'm missing something, in which case maybe
> > the current behavior is correct?
>
> In short, I think Simon is right that there's a problem and right
> about which commit caused it, but I'm not sure what I think we ought
> to do about it.

I'm comfortable with ignoring it, on the basis that it *is* a
performance optimization, but I suggest we keep the test (with
modified output) and document the behavior, if we do.

The really big issue is the loss of performance we get from having
subtrans point only to its immediate parent, which makes
XidInMVCCSnapshot() go really slow in the presence of lots of
subtransactions. So ignoring the issue on this thread will open the
door for the optimization posted for this patch:
https://commitfest.postgresql.org/40/3806/

--
Simon Riggs http://www.EnterpriseDB.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vik Fearing 2022-11-29 12:58:21 Re: Patch: Global Unique Index
Previous Message Amit Kapila 2022-11-29 12:52:29 Re: Introduce a new view for checkpointer related stats