pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Philip Warner <pjw@rhyme.com.au>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Timeout in Logical Replication
Date: Sat, 29 Jul 2023 23:49:57 +1000
Message-ID: <20230729135001.6E953220100@thebes.rime.com.au> (raw)

Logical replication from PG 15.3 to 15.2 has been running without problems until a few days ago.

Now the subscriber shows repeated messages like:
```
2023-07-29 08:25:04.523 UTC [26] LOG:  checkpoint complete: wrote 8692 buffers (53.1%); 0 WAL file(s) added, 1 removed, 14 recycled; write=269.921 s, sync=0.485 s, total=270.438 s; sync files=37, longest=0.224 s, average=0.014 s; distance=230568 kB, estimate=436766 kB

2023-07-29 08:25:34.550 UTC [26] LOG:  checkpoint starting: time

2023-07-29 08:27:55.699 UTC [142] ERROR:  could not receive data from WAL stream: server closed the connection unexpectedly

		This probably means the server terminated abnormally
		before or while processing the request.

2023-07-29 08:27:55.702 UTC [159] LOG:  logical replication apply worker for subscription "<SUB_NAME>" has started

2023-07-29 08:27:55.706 UTC [1] LOG:  background worker "logical replication worker" (PID 142) exited with exit code 1
```

And the publisher shows repeated messages like:
```
2023-07-29 08:24:50.341 UTC [530982] STATEMENT:  START_REPLICATION SLOT "<SUB NAME>" LOGICAL 37D1/1E0DD9A0 (proto_version '3', publication_names '"<PUB NAME>"')
2023-07-29 08:27:36.956 UTC [530982] LOG:  terminating walsender process due to replication timeout
2023-07-29 08:27:36.956 UTC [530982] CONTEXT:  slot "<SUB NAME>", output plugin "pgoutput", in the change callback, associated LSN 37D0/F9E8C2E8
```

I can connect using `psql` from either node back to the other. As far as I have been able to determine no routing or firewall changes have been made.

Reading other similar reports suggests that deleting and recreating the sub will fix the problem, but I'd like to understand/avoid it.

Any suggestions on how to track this down would be appreciated.

-

Message-ID: <20230729135001.6E953220100@thebes.rime.com.au>
Permalink:  ../20230729135001.6E953220100@thebes.rime.com.au/
Also on:    postgresql.org/message-id/20230729135001.6E953220100@thebes.rime.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: pjw@rhyme.com.au
  Subject: Re: Timeout in Logical Replication
  In-Reply-To: <20230729135001.6E953220100@thebes.rime.com.au>
  References: <20230729135001.6E953220100@thebes.rime.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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