agora inbox for pgpool-committers@postgresql.org
help / color / mirror / Atom feedFrom: Taiki Koshino <koshino@sraoss.co.jp>
To: pgpool-committers@lists.postgresql.org
Subject: pgpool: Fix hang on deferred constraint errors in pipeline mode
Date: Fri, 18 Sep 2026 05:30:32 +0000
Message-ID: <E1x7RBA-0000000DKaN-14Gc@gothos.postgresql.org> (raw)
Fix hang on deferred constraint errors in pipeline mode
PostgreSQL 19 and later include a psql_pipeline regression test for a
deferred constraint violation at commit time. When this test is run
through Pgpool-II, it hangs after reporting the constraint violation.
The test sends Sync at the end of a pipeline containing an INSERT into
a table with a DEFERRABLE INITIALLY DEFERRED primary key. PostgreSQL
detects the duplicate key while processing Sync and returns an
ErrorResponse.
Previously, read_kind_from_backend() removed the pending Sync message
when it received the ErrorResponse. ErrorResponse processing then
incorrectly concluded that Sync had not yet been received from the
frontend and waited for another Sync. Since psql had already sent Sync
as part of \endpipeline, both sides waited indefinitely and the
psql_pipeline test failed to complete.
Keep the pending Sync message in the queue when an ErrorResponse is
received. This allows error processing to recognize that Sync has
already been received and to continue processing through
ReadyForQuery. Test is also added.
Author: Taiki Koshino <koshino@srasoss.co.jp>
Discussion: https://www.postgresql.org/message-id/OS9P286MB6486B54CF8A848176B90539C94A42%40OS9P286MB6486.JPNP286...
Backpatch-through: v4.3
Branch
------
V4_5_STABLE
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=a177ff5eb985638fb0d91a1725741402abb5e...
Modified Files
--------------
src/protocol/pool_process_query.c | 9 ++-
.../regression/tests/134.pipeline/pgproto.data | 11 ++++
src/test/regression/tests/134.pipeline/test.sh | 65 ++++++++++++++++++++++
3 files changed, 84 insertions(+), 1 deletion(-)
view thread (6+ messages) latest in thread
Message-ID: <E1x7RBA-0000000DKaN-14Gc@gothos.postgresql.org>
Permalink: ../E1x7RBA-0000000DKaN-14Gc@gothos.postgresql.org/
Also on: postgresql.org/message-id/E1x7RBA-0000000DKaN-14Gc@gothos.postgresql.org
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgpool-committers@postgresql.org
Cc: koshino@sraoss.co.jp, pgpool-committers@lists.postgresql.org
Subject: Re: pgpool: Fix hang on deferred constraint errors in pipeline mode
In-Reply-To: <E1x7RBA-0000000DKaN-14Gc@gothos.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox