Subject: pgpool: Fix to not call pool_get_transaction_isolation() in elog(DEBUG)

From: Tatsuo Ishii <[email-masked]>
Date: Tue, 19 May 2026 09:21:23 +0000

Fix to not call pool_get_transaction_isolation() in elog(DEBUG).

where_to_send_main_replica() and where_to_send_native_replication()
mistakenly called pool_get_transaction_isolation() in
ereport/elog(DEBUG1). Since pool_get_transaction_isolation() issues
do_query() inside, if the code path is executed in an aborted
transaction, do_query() raises a FATAL error. Actually this could
happen when an empty query is executed in an aborted transaction.  (DB
applications/drivers issue an empty query to probe whether connection
to pgpool is active or not).

To fix this, simply delete calls to
pool_get_transaction_isolation(). This of course remove the
information from ereport/elog output, I wasn't able to find
alternative way.

Author: Tatsuo Ishii <[email-masked]>

Backpatch-through: v4.5 where where_to_send_main_replica() and
where_to_send_native_replication() are implemented.

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=b4f38129cfe6b97f7a390a0e056f8b43ed5adf1d

Modified Files
--------------
src/context/pool_query_context.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)