Re: [PATCH] Avoid pallocs in async.c's "critical section"

From: Arseniy Mukhin <arseniy(dot)mukhin(dot)dev(at)gmail(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Avoid pallocs in async.c's "critical section"
Date: 2025-11-26 07:00:31
Message-ID: CAE7r3MLT9Bivi6DQxG=5D7Foic-DLu+sLfPbo8t-MJz0GCfBqg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Nov 25, 2025 at 9:14 PM Joel Jacobson <joel(at)compiler(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikhil Kumar Veldanda 2025-11-26 07:09:00 Re: Support for 8-byte TOAST values (aka the TOAST infinite loop problem)
Previous Message John Naylor 2025-11-26 06:55:30 Re: tuple radix sort