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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgsql: Delay commit status checks until freezing executes.
Date: 2023-01-04 15:02:59
Message-ID: CA+TgmobMdMGeBb=t8u5Z9++-V6cDfpJjSJtpAmUi=YEUPUA_mw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, Jan 4, 2023 at 1:53 AM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> I think that we should definitely have a comment directly over
> TransactionIdDidAbort(). Though I wouldn't mind reorganizing these
> other comments, or making the comment over TransactionIdDidAbort()
> mostly just point to the other comments.

Yeah, I think it would be good to have a comment there. As Andres
says, it is almost always wrong to use this function, and we should
make that more visible. Possibly we should even rename the function,
like TransactionIdKnownToHaveAborted().

But that having been said, I'm kind of astonished that you didn't know
about this already. The freezing behavior is in general extremely hard
to get right, and I guess I feel if you don't understand how the
underlying functions work, including things like performance
considerations and which functions return fully reliable results, I do
not think you should be committing your own patches in this area.
There is probably a lot of potential benefit in improving the way this
stuff works, but there is also a heck of a lot of danger of creating
subtle data corrupting bugs that could easily take years to find.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Ibrar Ahmed 2023-01-04 15:04:53 Re: explain analyze rows=%.0f
Previous Message Drouvot, Bertrand 2023-01-04 14:49:45 Re: Add a new pg_walinspect function to extract FPIs from WAL records