Re: pgsql: Delay commit status checks until freezing executes.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgsql: Delay commit status checks until freezing executes.
Date: 2023-01-04 06:41:35
Message-ID: CAH2-WzmYObiABaysh1SSNBgm0OPYm07DNzRq2vA1DgsOtrodFQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Jan 3, 2023 at 10:33 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> I'd say a comment above TransactionIdDidAbort() referencing an overview
> comment at the top of the file? I think it might be worth moving the comment
> from heapam_visibility.c to transam.c?

What comments in heapam_visibility.c should we be referencing here? I
don't see anything about it there. I have long been aware that those
routines deduce that a transaction must have aborted, but surely
that's not nearly enough. That's merely not being broken, without any
explanation given as to why.

> > I find this astonishing. Why isn't there a prominent comment that
> > advertises that TransactionIdDidAbort() just doesn't work reliably?
>
> Arguably it works reliably, just more narrowly than one might think. Treating
> "crashed transactions" as a distinct state from explicit aborts.

That's quite a stretch. There are numerous comments that pretty much
imply that TransactionIdDidCommit/TransactionIdDidAbort are very
similar, for example any discussion of how you need to call
TransactionIdIsInProgress first before calling either of the other
two.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2023-01-04 06:47:40 Re: pgsql: Delay commit status checks until freezing executes.
Previous Message Andres Freund 2023-01-04 06:33:25 Re: pgsql: Delay commit status checks until freezing executes.

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2023-01-04 06:45:34 Fix showing XID of a spectoken lock in an incorrect field of pg_locks view.
Previous Message Masahiko Sawada 2023-01-04 06:39:54 Re: Perform streaming logical transactions by background workers and parallel apply