Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qPkKn-00BufR-GQ for pgsql-general@arkaria.postgresql.org; Sat, 29 Jul 2023 13:50:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qPkKj-005PNQ-TX for pgsql-general@arkaria.postgresql.org; Sat, 29 Jul 2023 13:50:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qPkKi-005PNI-Bn for pgsql-general@lists.postgresql.org; Sat, 29 Jul 2023 13:50:13 +0000 Received: from thebes.rime.com.au ([203.8.195.10]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qPkKb-002EEy-Vu for pgsql-general@lists.postgresql.org; Sat, 29 Jul 2023 13:50:11 +0000 Received: from localhost (localhost [127.0.0.1]) by thebes.rime.com.au (Postfix on SuSE Linux 8.0 (i386)) with ESMTP id 6E953220100 for ; Sat, 29 Jul 2023 23:50:01 +1000 (AEST) X-Virus-Scanned: by amavisd-new at rime.com.au Received: from thebes.rime.com.au ([127.0.0.1]) by localhost (thebes.rime.com.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c_TBZZLw39Ld for ; Sat, 29 Jul 2023 23:49:57 +1000 (AEST) Received: from [IPv6:::ffff:192.168.1.101] (14-203-163-235.tpgi.com.au [14.203.163.235]) by thebes.rime.com.au (Postfix on SuSE Linux 8.0 (i386)) with ESMTPSA id 797302200FF for ; Sat, 29 Jul 2023 23:49:57 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rhyme.com.au; s=selector1; t=1690638597; bh=wlLDj14ViMKlKv8EpUP67LaHrJ6UQ+eBymv+Ei6F4Lk=; h=To:From:Subject:Date; b=EYwV+DlQeXZ0ed+53dk3ndwfnYdVjIMxNIUVWNiLoFmxPDzDYC4ucXCzD7h/EnIvF bgZTzF7hTsPtHej7hJk3Oe5giV1CHF6UFOQ54am/oHNnnSpIKmROxB4+dfTguUd0RM X1iVfWEkyLZ4JC6BSaDY0eWJzgmM/pCHz/hJsz/Y= MIME-Version: 1.0 To: "pgsql-general@lists.postgresql.org" From: Philip Warner Subject: Timeout in Logical Replication Date: Sat, 29 Jul 2023 23:49:57 +1000 Importance: normal X-Priority: 3 Content-Type: multipart/alternative; boundary="_BC960870-DFD6-4027-966B-6FBFB1E0B3C2_" Message-Id: <20230729135001.6E953220100@thebes.rime.com.au> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_BC960870-DFD6-4027-966B-6FBFB1E0B3C2_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 buff= ers (53.1%); 0 WAL file(s) added, 1 removed, 14 recycled; write=3D269.921 s= , sync=3D0.485 s, total=3D270.438 s; sync files=3D37, longest=3D0.224 s, av= erage=3D0.014 s; distance=3D230568 kB, estimate=3D436766 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 s= tream: 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 fo= r subscription "" has started 2023-07-29 08:27:55.706 UTC [1] LOG: background worker "logical replicatio= n 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 "" LOGICAL 37D1/1E0DD9A0 (proto_version '3', publication_names '""') 2023-07-29 08:27:36.956 UTC [530982] LOG: terminating walsender process du= e to replication timeout 2023-07-29 08:27:36.956 UTC [530982] CONTEXT: slot "", output pl= ugin "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. - --_BC960870-DFD6-4027-966B-6FBFB1E0B3C2_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

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

 

Now the subscriber s= hows repeated messages like:

```

2023-07-29 08:25:04.523 UTC [26] LOG:=C2=A0 checkpoint complete: wrot= e 8692 buffers (53.1%); 0 WAL file(s) added, 1 removed, 14 recycled; write= =3D269.921 s, sync=3D0.485 s, total=3D270.438 s; sync files=3D37, longest= =3D0.224 s, average=3D0.014 s; distance=3D230568 kB, estimate=3D436766 kB

 

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

 

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

 

=

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 This probably means the server terminated abnor= mally

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 before or while processing the request= .

 

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

 

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

```

 

And the publisher shows rep= eated messages like:

```

20= 23-07-29 08:24:50.341 UTC [530982] STATEMENT:=C2=A0 START_REPLICATION SLOT = "<SUB NAME>" LOGICAL 37D1/1E0DD9A0 (proto_version '3', publ= ication_names '"<PUB NAME>"')

2023-= 07-29 08:27:36.956 UTC [530982] LOG:=C2=A0 terminating walsender process du= e to replication timeout

2023-07-29 08:27:36.956 UT= C [530982] CONTEXT:=C2=A0 slot "<SUB NAME>", output plugin = "pgoutput", in the change callback, associated LSN 37D0/F9E8C2E8<= /p>

```

 

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 chang= es have been made.

 

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

 

Any suggestion= s on how to track this down would be appreciated.

<= o:p> 

-

 

= --_BC960870-DFD6-4027-966B-6FBFB1E0B3C2_--