TransactionIdIsActive() has long been unused

Started by Andres Freund9 months ago4 messageshackers
Jump to latest
#1Andres Freund
andres@anarazel.de

Hi,

While looking at Tomas' NUMA patchset I got curious what we use
TransactionIdIsActive() for (it's modified in the patchset). Turns out we
don't. And haven't for a long while, the last use was removed in

commit bb38fb0d43c
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2014-05-15 16:37:50 +0300

Fix race condition in preparing a transaction for two-phase commit.

Seems like we should just remove TransactionIdIsActive()?

Greetings,

Andres Freund

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#1)
Re: TransactionIdIsActive() has long been unused

Andres Freund <andres@anarazel.de> writes:

Seems like we should just remove TransactionIdIsActive()?

+1. I wondered if any extensions might depend on it, but
could not find any trace of that in Debian code search.
And it's a sufficiently odd test (as noted in its comments)
that one could debate whether using it for an extension's
purposes would be correct anyway.

regards, tom lane

#3Michael Paquier
michael@paquier.xyz
In reply to: Tom Lane (#2)
Re: TransactionIdIsActive() has long been unused

On Wed, Jul 09, 2025 at 03:46:43PM -0400, Tom Lane wrote:

Andres Freund <andres@anarazel.de> writes:

Seems like we should just remove TransactionIdIsActive()?

+1. I wondered if any extensions might depend on it, but
could not find any trace of that in Debian code search.
And it's a sufficiently odd test (as noted in its comments)
that one could debate whether using it for an extension's
purposes would be correct anyway.

+1.
--
Michael
#4Andres Freund
andres@anarazel.de
In reply to: Michael Paquier (#3)
Re: TransactionIdIsActive() has long been unused

Hi,

On 2025-07-10 09:52:45 +0900, Michael Paquier wrote:

On Wed, Jul 09, 2025 at 03:46:43PM -0400, Tom Lane wrote:

Andres Freund <andres@anarazel.de> writes:

Seems like we should just remove TransactionIdIsActive()?

+1. I wondered if any extensions might depend on it, but
could not find any trace of that in Debian code search.
And it's a sufficiently odd test (as noted in its comments)
that one could debate whether using it for an extension's
purposes would be correct anyway.

+1.

Great. Thanks for checking Tom, Michael. Pushed.

Greetings,

Andres Freund