Re: BUG #19494: Error on transaction commit inside pipeline triggers psql's Assert - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #19494: Error on transaction commit inside pipeline triggers psql's Assert
Date
Msg-id ahkdZJMZvyYlsfXK@paquier.xyz
Whole thread
In response to Re: BUG #19494: Error on transaction commit inside pipeline triggers psql's Assert  (Alexander Lakhin <exclusion@gmail.com>)
Responses Re: BUG #19494: Error on transaction commit inside pipeline triggers psql's Assert
List pgsql-bugs
On Fri, May 29, 2026 at 07:00:01AM +0300, Alexander Lakhin wrote:
> it's happening upon/after postgres process termination, so PQgetResult()
> returns NULL, pset.piped_syncs == 1. I need more time to look deeper and
> to come with a reproducer, but maybe you can already see what's wrong.

Yeah, I do.  Nice catch.  See this sequence to reproduce the problem:
\startpipeline
INSERT INTO psql_pipeline_defer VALUES (1), (1) \bind \sendpipeline
\syncpipeline
SELECT pg_terminate_backend(pg_backend_pid()) \bind \sendpipeline
SELECT 1 \bind \sendpipeline
\endpipeline

When ending the pipeline the loop consuming the results is stuck, so
we could check the connection state.  We are going to enter in a
freeze of the branches due to beta1 next week, so let's take our time.

Please feel to use the v2 attached for your tests.  I am also testing
it more on my side.
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: BUG #19494: Error on transaction commit inside pipeline triggers psql's Assert
Next
From: Álvaro Herrera
Date:
Subject: Re: BUG #19500: pgrepack logical decoding plugin can crash assert builds via SQL decoding API