Re: Racing in ROLLBACK PREAPRED and checkpoint

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Racing in ROLLBACK PREAPRED and checkpoint
Date: 2026-11-02 00:56:19
Message-ID: auffs5zNMJFUr_K8@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 29, 2026 at 12:00:56AM -0400, shihao zhong wrote:
> The commit side has had this since the two-phase commit went in. The abort
> side was written like a regular abort, and its comment says the pg_xact
> update "is not absolutely necessary". That is true for a regular abort,
> but here the state file can bring the transaction back.
>
> This needs to be backported to 14.

As far as I can see, that's pretty old. Dragging into the history of
the code, this issue is at least as old as 9c9b619473cd where the
inCommit flag has been introduced in replacement for the LWLocks.
It's as old as the introduction of 2PC back in 2005.

I'll spend a bit more time on that today, but your suggestion of just
relying on delayChkptFlags should do it, like the COMMIT PREPARED
path.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2026-11-02 01:44:47 Re: Wrong LSN in WAL decoding error messages
Previous Message Fujii Masao 2026-11-02 00:47:09 Re: pgbench --unlogged-tables silently ignored for branches/tellers/history when --partitions is used