Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k2bc1-0006WN-IV for pgsql-general@arkaria.postgresql.org; Mon, 03 Aug 2020 14:38:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k2bc0-0003f0-5V for pgsql-general@arkaria.postgresql.org; Mon, 03 Aug 2020 14:38:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k2bbz-0003es-Oz for pgsql-general@lists.postgresql.org; Mon, 03 Aug 2020 14:38:47 +0000 Received: from p3plsmtpa06-06.prod.phx3.secureserver.net ([173.201.192.107]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k2bbx-0002Zz-4u for pgsql-general@postgresql.org; Mon, 03 Aug 2020 14:38:46 +0000 Received: from johns-imac-4.home ([100.11.14.6]) by :SMTPAUTH: with ESMTPA id 2bbuktMqTcPrZ2bbvk07S9; Mon, 03 Aug 2020 07:38:43 -0700 X-CMAE-Analysis: v=2.3 cv=K7hc4BeI c=1 sm=1 tr=0 a=CBQM/fRm8ns2oaVrUFkZfg==:117 a=CBQM/fRm8ns2oaVrUFkZfg==:17 a=onc9sL0xAAAA:8 a=8ytChCLpXdjCO1VOpOcA:9 a=QEXdDO2ut3YA:10 a=7c-QrhQ318YA:10 a=0j-xl0pdmN0A:10 a=QVp75at2-OQA:10 a=wXLcwSpnUBAA:10 a=GGwbZiSZ16mET1NY:21 a=_W_S_7VecoQA:10 a=2uP6OJQpDPYV30S8qlIA:9 a=ZVk8-NSrHBgA:10 a=D1Mt0Of_GMHOm1B_mR0f:22 X-SECURESERVER-ACCT: john.ashmead@ashmeadsoftware.com From: John Ashmead Content-Type: multipart/signed; boundary="Apple-Mail=_9BDB630D-C159-49D2-B68F-8DFD952C9653"; protocol="application/pkcs7-signature"; micalg=sha-256 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: How can you find out what point logical replication is at? Date: Mon, 3 Aug 2020 10:38:42 -0400 References: <1934924.1596306669@sss.pgh.pa.us> To: pgsql-general@postgresql.org In-Reply-To: <1934924.1596306669@sss.pgh.pa.us> Message-Id: <06C3100D-2C47-4707-B426-14D00A95260B@ashmeadsoftware.com> X-Mailer: Apple Mail (2.3445.104.14) X-CMAE-Envelope: MS4wfENOvUGJW1bEaAyly+Z69N2qoCDMgSCpSpw/lYV2AeMWSSoOvrq1NaQiWD4GU0Ry7hcQOlRFzMu9MoYLE49dhtt7/Az1QriyryGit4cSVkno2rLXObpe V4/Vfhzt7oyF45cbsiJPzswTosxnsKOSAyvQs09OUFt+rYoV5h59Eu7j7MnP1QKLRYO/lfva6cDfWHv4Q2AJTAulh/K2YqQEGnw= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_9BDB630D-C159-49D2-B68F-8DFD952C9653 Content-Type: multipart/alternative; boundary="Apple-Mail=_6825D43E-2221-42DC-989F-927EC85F3281" --Apple-Mail=_6825D43E-2221-42DC-989F-927EC85F3281 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I have logical replication setup from a factory in Zhuhai China to a = data warehouse in New Jersey. We are using postgresql 10.13 on both = sides, on Redhat Linux 7.6. The logical replication has been in =E2=80=9Ccatchup=E2=80=9D mode for = several days now, stuck at a specific LSN (9EF/89ADF7E0). The slave side = seems to be chugging along, generating lots of WAL files =E2=80=94 but = not actually getting any new records in.=20 The logical replication is being used to move some fairly large files: = averaging about 1 MB but with a max up to about 250 MB. (I think I want = to fix that longer term, but that=E2=80=99s not a quick fix.) My working hypothesis is that we are stuck on a long transaction: that = we can=E2=80=99t get some abnormally large blob over before we drop the = line. In this case fixing the connection should fix the problem. Is there a way I can see what is going on? The slave is working hard, = but what is it working on? And are there any suggestions on how to handle this? I could restart the logical replication with =E2=80=9Ccopy_data =3D = false=E2=80=9D, then fill in the holes by hand. But I would rather not! Thanks in advance! John PS. Output of pg_stat_replication & pg_stat_subscription on master & = slave respectively. (Some proprietary information X=E2=80=99d out) select * from pg_stat_replication; -[ RECORD 1 ]----+------------------------------ pid | 42451 usesysid | 10 usename | postgres application_name | china_to_nj_sub client_addr | XXX.XXX.XXX.XXX client_hostname |=20 client_port | 54300 backend_start | 2020-08-03 09:07:07.257454-04 backend_xmin | 16574498 state | catchup sent_lsn | 9EF/89ADF7E0 write_lsn | 9EF/89ADF7E0 flush_lsn | 9EF/89ADF7E0 replay_lsn | 9EF/89ADF7E0 write_lag |=20 flush_lag |=20 replay_lag |=20 sync_priority | 0 sync_state | async select * from pg_stat_subscription; -[ RECORD 1 ]---------+------------------------------ subid | 7222699 subname | china_to_nj_sub pid | 14764 relid |=20 received_lsn | 9EF/89ADF7E0 last_msg_send_time | 2020-08-03 10:15:48.644575-04 last_msg_receipt_time | 2020-08-03 10:14:57.247993-04 latest_end_lsn | 9EF/89ADF7E0 latest_end_time | 2020-08-03 09:30:57.974223-04 John Ashmead 139 Montrose Avenue Rosemont, PA, 19010-1508 (610) 527 9560=20 mobile (610) 247 2323 john.ashmead@ashmeadsoftware.com = --Apple-Mail=_6825D43E-2221-42DC-989F-927EC85F3281 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 I have logical = replication setup from a factory in Zhuhai China to a data warehouse in = New Jersey. We are using postgresql 10.13 on both sides, on Redhat Linux = 7.6.

The logical replication has been in =E2=80=9Ccatchup=E2=80=9D = mode for several days now, stuck at a specific LSN (9EF/89ADF7E0). The = slave side seems to be chugging along, generating lots of WAL files =E2=80= =94 but not actually getting any new records in. 

The logical replication = is being used to move some fairly large files:  averaging about 1 = MB but with a max up to about 250 MB. (I think I want to fix that longer = term, but that=E2=80=99s not a quick fix.)

My working hypothesis is that we are = stuck on a long transaction: that we can=E2=80=99t get some abnormally = large blob over before we drop the line.  In this case fixing the = connection should fix the problem.

Is there a way I can see what is going = on?  The slave is working hard, but what is it working = on?

And are = there any suggestions on how to handle this?

I could restart the logical replication = with =E2=80=9Ccopy_data =3D false=E2=80=9D, then fill in the holes by = hand.  But I would rather not!

Thanks in advance!

John

PS. Output of = pg_stat_replication & pg_stat_subscription on master & slave = respectively.  (Some proprietary information X=E2=80=99d = out)

select * from pg_stat_replication;
-[ = RECORD 1 ]----+------------------------------
pid =              | 42451
usesysid         | 10
usename          | = postgres
application_name | = china_to_nj_sub
client_addr      | = XXX.XXX.XXX.XXX
client_hostname =  | 
client_port      | = 54300
backend_start    | 2020-08-03 = 09:07:07.257454-04
backend_xmin     | = 16574498
state           =  | catchup
sent_lsn       =   | 9EF/89ADF7E0
write_lsn     =    | 9EF/89ADF7E0
flush_lsn     =    | 9EF/89ADF7E0
replay_lsn   =     | 9EF/89ADF7E0
write_lag   =      | 
flush_lag     =    | 
replay_lag     =   | 
sync_priority    | = 0
sync_state       | async

 select * from = pg_stat_subscription;
-[ RECORD 1 = ]---------+------------------------------
subid =                 | = 7222699
subname           =     | china_to_nj_sub
pid     =               | 14764
relid                 = | 
received_lsn         =  | 9EF/89ADF7E0
last_msg_send_time   =  | 2020-08-03 10:15:48.644575-04
last_msg_receipt_time | 2020-08-03 = 10:14:57.247993-04
latest_end_lsn     =    | 9EF/89ADF7E0
latest_end_time   =     | 2020-08-03 09:30:57.974223-04


John = Ashmead
139 Montrose Avenue
Rosemont, PA, 19010-1508
(610) 527 = 9560 
mobile (610) 247 2323






= --Apple-Mail=_6825D43E-2221-42DC-989F-927EC85F3281-- --Apple-Mail=_9BDB630D-C159-49D2-B68F-8DFD952C9653 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglgh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