agora inbox for pgpool-committers@postgresql.org  
help / color / mirror / Atom feed
pgpool: Fix hang on deferred constraint errors in pipeline mode
6+ messages / 1 participants
[nested] [flat]

* pgpool: Fix hang on deferred constraint errors in pipeline mode
@ 2026-09-18 05:29 Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-18 05:29 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

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
------
master

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

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(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix hang on deferred constraint errors in pipeline mode
@ 2026-09-18 05:29 Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-18 05:29 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

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_7_STABLE

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

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(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix hang on deferred constraint errors in pipeline mode
@ 2026-09-18 05:30 Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-18 05:30 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

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_6_STABLE

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

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(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix hang on deferred constraint errors in pipeline mode
@ 2026-09-18 05:30 Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-18 05:30 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix hang on deferred constraint errors in pipeline mode
@ 2026-09-18 05:30 Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-18 05:30 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

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_4_STABLE

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

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(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix hang on deferred constraint errors in pipeline mode
@ 2026-09-18 05:31 Taiki Koshino <koshino@sraoss.co.jp>
  0 siblings, 0 replies; 6+ messages in thread

From: Taiki Koshino @ 2026-09-18 05:31 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

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_3_STABLE

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

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(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-09-18 05:31 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-18 05:29 pgpool: Fix hang on deferred constraint errors in pipeline mode Taiki Koshino <koshino@sraoss.co.jp>
2026-09-18 05:29 pgpool: Fix hang on deferred constraint errors in pipeline mode Taiki Koshino <koshino@sraoss.co.jp>
2026-09-18 05:30 pgpool: Fix hang on deferred constraint errors in pipeline mode Taiki Koshino <koshino@sraoss.co.jp>
2026-09-18 05:30 pgpool: Fix hang on deferred constraint errors in pipeline mode Taiki Koshino <koshino@sraoss.co.jp>
2026-09-18 05:30 pgpool: Fix hang on deferred constraint errors in pipeline mode Taiki Koshino <koshino@sraoss.co.jp>
2026-09-18 05:31 pgpool: Fix hang on deferred constraint errors in pipeline mode Taiki Koshino <koshino@sraoss.co.jp>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox