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

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

Hi,

On 2023-01-03 22:41:35 -0800, Peter Geoghegan wrote:
> 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.

IMO the comment at the top mentioning why the TransactionIdIsInProgress()
calls are crucial / need to be done first would be considerably more likely to
be found in transam.c than heapam_visibility.c. And it'd make sense to have
the explanation of why TransactionIdDidAbort() isn't the same as
!TransactionIdDidCommit(), even for !TransactionIdIsInProgress() xacts, near
the explanation for doing TransactionIdIsInProgress() first.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2023-01-04 06:52:51 Re: pgsql: Delay commit status checks until freezing executes.
Previous Message Peter Geoghegan 2023-01-04 06:41:35 Re: pgsql: Delay commit status checks until freezing executes.

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2023-01-04 06:52:51 Re: pgsql: Delay commit status checks until freezing executes.
Previous Message Masahiko Sawada 2023-01-04 06:45:34 Fix showing XID of a spectoken lock in an incorrect field of pg_locks view.