pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #18754: Logical replication cannot restart if client sent a copyDone
2+ messages / 2 participants
[nested] [flat]

* BUG #18754: Logical replication cannot restart if client sent a copyDone
@ 2024-12-27 12:54 PG Bug reporting form <noreply@postgresql.org>
  2025-01-01 10:14 ` Re: BUG #18754: Logical replication cannot restart if client sent a copyDone vignesh C <vignesh21@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2024-12-27 12:54 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: ua.san.alex@gmail.com

The following bug has been logged on the website:

Bug reference:      18754
Logged by:          S.A.N
Email address:      ua.san.alex@gmail.com
PostgreSQL version: 17.2
Operating system:   MacOS
Description:        

Logical replication cannot restart if the client sent a copyDone, because
the streamingDoneReceiving variable is not reassigned to false in function
StartLogicalReplication, this only happens when physical replication in
function StartReplication
https://github.com/postgres/postgres/blob/master/src/backend/replication/walsender.c#L906

I am writing a logical replication client, sometimes I need to exit copy
mode to send simple SQL queries.

I send copyDone, everything works correctly, I can perform SQL queries, but
then I need to return to replication mode, the START_REPLICATION command
will always completed immediately, because the streamingDoneReceiving
backend variable remains in true, I think it should be redefined in false
when starting logical replication.

Thanks.



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

* Re: BUG #18754: Logical replication cannot restart if client sent a copyDone
  2024-12-27 12:54 BUG #18754: Logical replication cannot restart if client sent a copyDone PG Bug reporting form <noreply@postgresql.org>
@ 2025-01-01 10:14 ` vignesh C <vignesh21@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: vignesh C @ 2025-01-01 10:14 UTC (permalink / raw)
  To: ua.san.alex@gmail.com; pgsql-bugs@lists.postgresql.org

On Fri, 27 Dec 2024 at 20:44, PG Bug reporting form
<noreply@postgresql.org> wrote:
>
> The following bug has been logged on the website:
>
> Bug reference:      18754
> Logged by:          S.A.N
> Email address:      ua.san.alex@gmail.com
> PostgreSQL version: 17.2
> Operating system:   MacOS
> Description:
>
> Logical replication cannot restart if the client sent a copyDone, because
> the streamingDoneReceiving variable is not reassigned to false in function
> StartLogicalReplication, this only happens when physical replication in
> function StartReplication
> https://github.com/postgres/postgres/blob/master/src/backend/replication/walsender.c#L906
>
> I am writing a logical replication client, sometimes I need to exit copy
> mode to send simple SQL queries.
>
> I send copyDone, everything works correctly, I can perform SQL queries, but
> then I need to return to replication mode, the START_REPLICATION command
> will always completed immediately, because the streamingDoneReceiving
> backend variable remains in true, I think it should be redefined in false
> when starting logical replication.

In logical replication, however, the process exits after
streamingDoneReceiving is set to true (this happens when sending the
PqMsg_CopyDone message from libpqrcv_endstreaming), so the issue will
not happen in logical replication.
Could you share the client you're using(if it can be shared), along
with the steps you are following when encountering the issue? This
will help us better understand the scenario and potentially create a
test case to reproduce the issue, or at least validate if setting
'streamingDoneReceiving' to false is sufficient.

Regards,
Vignesh





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


end of thread, other threads:[~2025-01-01 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-12-27 12:54 BUG #18754: Logical replication cannot restart if client sent a copyDone PG Bug reporting form <noreply@postgresql.org>
2025-01-01 10:14 ` vignesh C <vignesh21@gmail.com>

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