Re: FATAL: could not send end-of-streaming message to primary: no COPY in progress

From: Stepan Neretin <slpmcf(at)gmail(dot)com>
To: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Subject: Re: FATAL: could not send end-of-streaming message to primary: no COPY in progress
Date: 2026-11-22 15:53:25
Message-ID: CA+Yyo5QzkBdQUxk+nYR0Bmm-b5ch7fHa3Lmghu3HjqmXG_d8tA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Nov 22, 2026 at 9:08 PM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:

> > Attached.
>
> I haven't looked at the test yet.
>
> + * end of streaming.
> + */
> + if (conn->copyEnded)
> + {
> + conn->copyEnded = false;
> + *next_tli = 0;
> + return;
> + }
>
> BTW, we can move *next_tli = 0; to the start of
> libpqrcv_endstreaming() to save one extra assignment.
>
> --
> Regards,
> Xuneng Zhou
> HighGo Software Co., Ltd.
>

Hi,

Thanks. Agreed. v6 moves *next_tli = 0 to the start of
libpqrcv_endstreaming(). Nothing else changed.

Attached.

Regards,
Stepan Neretin

Attachment Content-Type Size
v6-0001-Fix-FATAL-when-primary-ends-streaming-with-COPY-0.patch text/x-patch 6.6 KB
v6-0002-Add-TAP-tests-for-primary-publisher-shutdown-duri.patch text/x-patch 8.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rui Zhao 2026-11-22 15:58:13 Re: Showing "Table Block Fetches" in EXPLAIN ANALYZE for index-only scans
Previous Message Hüseyin Demir 2026-11-22 15:08:06 Re: [PATCH] Report changes discarded for relations not in the subscription