Re: BUG #19616: pgoutput sends stream abort ('A') to clients that did not enable streaming - Mailing list pgsql-bugs

From Andrey Rachitskiy
Subject Re: BUG #19616: pgoutput sends stream abort ('A') to clients that did not enable streaming
Date
Msg-id CAB8bMiuU56wc+3Pt2hmLLPCM1+EFR93cJqFH-yELo08TuRcXRA@mail.gmail.com
Whole thread
In response to RE: BUG #19616: pgoutput sends stream abort ('A') to clients that did not enable streaming  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
List pgsql-bugs


сб, 15 авг. 2026 г. в 03:15, Masahiko Sawada <sawada.mshk@gmail.com>:
While the fix
looks good to me, I have a few review comments on the regression test
part:

+-- bug #19616
+-- pgoutput protocol compatibility could be broken for an aborted xact
+-- discarded at spill eviction while a subxact remained in memory.
+-- Stream Abort ('A'), valid only since protocol version 2, could be seen
+-- with protocol version 1.
...
+SELECT chr(get_byte(data, 0)) AS msgtype, count(*)
+FROM pg_logical_slot_peek_binary_changes('regression_slot_pgoutput',
NULL, NULL,
+     'proto_version', '1', 'publication_names', 'spill_pub')
+GROUP BY 1 ORDER BY 1;

I'm not sure we should test the case against proto_version=1 for the
reason I mentioned above. I think we can use proto_version=4 and
streaming=0 instead. Also, the comment needs to be adjusted.

stream.sql would be more suitable to put this test.

Dear Sawada-san,
 
You are right, and these remarks have been addressed in v5 of the patch.

The spurious Stream Abort is not really about the protocol version.
So the real invariant is that a client which did not enable streaming
must not receive streaming messages. proto_version=1 only tested a
special case.  proto_version=4 with streaming=0 exercises the
invariant directly. I confirmed the reformulated test still catches the bug.
I moved the test to stream.sql as you suggested, keeping the structure of
the already-reviewed comment. 

--
Regards,
Rachitskiy Andrey
Attachment

pgsql-bugs by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: BUG #19613: pg_restore: several SEGVs in ReadToc() in pg_backup_archiver.c
Next
From: Michael Paquier
Date:
Subject: Re: BUG #19612: SEGV in ParseConfigFp() in guc-file.l