Re: Fix concurrent-abort detection for subtransactions of prepared transactions

From: Rahila Syed <rahilasyed90(at)gmail(dot)com>
To: Vaijayanti Bharadwaj <vaijayanti(dot)bharadwaj(at)enterprisedb(dot)com>
Cc: pgsql-hackers mailing list <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: Re: Fix concurrent-abort detection for subtransactions of prepared transactions
Date: 2026-10-27 14:59:37
Message-ID: CAH2L28vc1M7QwSK5MKC5-L=Z77RjmuyNHJ1XHW1cktf3SD5Ryw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Vaijayanti,

Thank you for reporting this bug. I verified that the patch indeed
fixes the problem.

Please see a couple of comments below:

1. The commit that introduced the underlying code is a271a1b50e9, which was
released with PG14; however, the patch mentions backporting the fix up
to PG15. Is this
intentional?

>
> if (streaming || rbtxn_is_prepared(rbtxn_get_toptxn(change->txn)))
>
> Once the transaction is prepared, its subtransactions commit or abort together with it. The error handler already tests rbtxn_is_prepared(txn) on the top-level transaction, so it needs no change.

2. A nitpick: Should the check be replaced by rbtxn_is_prepared(txn)
instead of the rbxtn_get_toptxn(change->txn). The `txn` in
`ReorderBufferProcessTXN` is a top level transaction and this function
calls the exact same check further below which would make it
consistent.

Apart from that, the changes look good to me.

Adding Amit Kapila to CC since he is the author of the original commit.

Thank you,
Rahila Syed

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tristan Partin 2026-10-27 15:51:39 Re: Add compiler option -fstrict-flex-arrays=1
Previous Message Bohyun Lee 2026-10-27 14:49:14 Re: [PATCH] pg_upgrade: add --initdb option to create the new cluster automatically