Re: [PATCH] Avoid pallocs in async.c's "critical section" - Mailing list pgsql-hackers

From Arseniy Mukhin
Subject Re: [PATCH] Avoid pallocs in async.c's "critical section"
Date
Msg-id CAE7r3MLT9Bivi6DQxG=5D7Foic-DLu+sLfPbo8t-MJz0GCfBqg@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Avoid pallocs in async.c's "critical section"  ("Joel Jacobson" <joel@compiler.org>)
List pgsql-hackers
Hi,

On Tue, Nov 25, 2025 at 9:14 PM Joel Jacobson <joel@compiler.org> wrote:
>
> ...
> Darn, I forgot about the edge-case where something fails in xact.c
> in between PreCommit_Notify(); and AtCommit_Notify();
> causing an abort.
>
> In this case, AtAbort_Notify() would need to undo the effect
> of the LISTEN/UNLISTEN commands that would already have been
> executed, with the 0003 patch.
>
> A normal BEGIN; LISTEN foo; ROLLBCK; is not a problem though,
> since that will never reach PreCommit_Notify().
>
> Just curious, what type of problems could cause an abort between
> PreCommit_Notify and AtCommit_Notify?
>

Serializable conflict could cause an abort after PreCommit_Notify.
0002 in [0] is an example of how it can be reproduced.

[0] https://www.postgresql.org/message-id/CAE7r3MJgJj4D_6mPHMr-4xCrYK7q04M3jM1J_=4baphjA2WeBA@mail.gmail.com


Best regards,
Arseniy Mukhin



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: tuple radix sort
Next
From: Nikhil Kumar Veldanda
Date:
Subject: Re: Support for 8-byte TOAST values (aka the TOAST infinite loop problem)