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

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: pgpool-committers(at)lists(dot)postgresql(dot)org
Subject: pgpool: Fix to not call pool_get_transaction_isolation() in elog(DEBUG)
Date: 2026-05-19 09:21:18
Message-ID: E1wPGdZ-00CJjc-30@gothos.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-committers

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 <ishii(at)postgresql(dot)org>

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

Branch
------
V4_7_STABLE

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

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

Browse pgpool-committers by date

  From Date Subject
Next Message Tatsuo Ishii 2026-05-19 09:21:23 pgpool: Fix to not call pool_get_transaction_isolation() in elog(DEBUG)
Previous Message Tatsuo Ishii 2026-05-19 09:21:12 pgpool: Fix to not call pool_get_transaction_isolation() in elog(DEBUG)