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

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, "tyler(at)smarts(dot)io" <tyler(at)smarts(dot)io>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #19616: pgoutput sends stream abort ('A') to clients that did not enable streaming
Date: 2026-08-17 20:46:03
Message-ID: CAD21AoBveDnemY2a2gGoAzXO7qXpXpXv0FNExnbNZEgDNO5r+g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Aug 14, 2026 at 7:27 PM Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com> wrote:
>
>
>
> сб, 15 авг. 2026 г. в 03:15, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)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.

Thank you for updating the patch!

We can verify that stream_abort callback is not called when the
streaming mode is disabled, and we can use test_decoding for the
regression test at the end of the day. Which is simpler. I've updated
the regression test part accordingly and the commit message. Please
review it.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v6-0001-Don-t-mark-discarded-aborted-subxacts-as-streamed.patch text/x-patch 7.4 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message zengman 2026-08-18 02:06:15 Re: BUG #19621: Unexpected results of JSON_VALUE with DEFAULT ON EMPTY
Previous Message zengman 2026-08-17 14:09:41 Re:BUG #19625: SQL/JSON boolean DEFAULT expression silently replaced with 'false'