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 1jiu1j-0003gR-DP for pgsql-general@arkaria.postgresql.org; Wed, 10 Jun 2020 06:15:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jiu1i-0001am-BE for pgsql-general@arkaria.postgresql.org; Wed, 10 Jun 2020 06:15:54 +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 1jiu1h-0001af-Ek for pgsql-general@lists.postgresql.org; Wed, 10 Jun 2020 06:15:54 +0000 Received: from mail-bn8nam11olkn2058.outbound.protection.outlook.com ([40.92.20.58] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiu1e-00068v-Ft for pgsql-general@postgresql.org; Wed, 10 Jun 2020 06:15:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=URWL+dlxjw0KOOyXm6nvfW4TzUi0cNMBxHOh/2X4NTs8utvC1yhdXtrsBBJC7/TkjD4pwwRVAzwG0wWSBWodxM+VCdvHXwtC+ONej0v4QI5mcwqPaCQD7jBPyt1KpL4WUDtGRN0f87Z0wAbQD4Dr/BZIr/0vRpTYZI+b4AynmuBnUXW3TOEEnaCJcrAVxUaYptk5eSzl2tEWVdBawfJqRh+9RiXvimWLpHpTMJCiOyzGEj6AHHaXH2UbfKI/6VGYsQaS13qnLoIH6iaw87Vh+nB4J8bILkUFWzvtFl0OH/DrhNDSduf1O8FQ6eAVcCEOvNLSk+VTJtyNwq/+lKuYjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jvh7tb2hVfTn86RDRn5Fpxk4bxY+r1LWriUJ/4HVj08=; b=gUECK8Uo5aO6TTcL7zQ2Ib5VB0/FJzoZrymzrxXHt1DJvpBgXHwagDZXxLeEbCPqJVaEJ4vwhwmVOS06i0Fpkl9+p4ZRx/gZuzHJ8g3NcVb0OMdPX0aXNTKT059Qoh2cksnGMxHGN1hfEJv1VSVy9B1Q0qHGrxFeyyYjvyXHtHHD5tYokBexz8OF8LdcGuBpPuW9dCFbTzJCGGJRLMewZS/kSXclHtxgP1fBxQAmrE24j+dPtsyBG4RlfVUJaszvZLx2gIEkRrmOgnyEdkfZcDQbxFzlJascJIv0IfD9dxXUKKodLJW/pxpFOrpD0ecWJzn+yvAT/VdDHHy6p11n9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jvh7tb2hVfTn86RDRn5Fpxk4bxY+r1LWriUJ/4HVj08=; b=OkuH9r5L7vm4mRAoNhc4JNcr4I2Loniur6xExL9lEx9Vi0NMgFrv0WcEFBCuqVcy/XaIpv752FjU1zz4yXUYZVATvNWZ5+74gjc7qSil1mCNBvuwxVzOyBRsS6pmm0CW6M85Qwdf3ZgFDwqWfHbetvSdCB9nLwX4Y7xJhBJ8lOrM8+sXACxo6fiGmihCK4KG4UF77pTsr/1JCkowzpzTtb6ketEvPtr63R4gpNl9MRr8MMAkb9Vohk2l/xJwruMdwJmr5LhcNOEcgJPwX3RWsLTM79y2vC3E24G9K9b5u6xk6BTRzxOhPuLZYqxPCvsmJ641hQu/s3N1wfgj6yac6Q== Received: from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::49) by BN8NAM11HT093.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.18; Wed, 10 Jun 2020 06:15:48 +0000 Received: from MN2PR02MB6447.namprd02.prod.outlook.com (2a01:111:e400:fc4b::4c) by BN8NAM11FT013.mail.protection.outlook.com (2a01:111:e400:fc4b::182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.18 via Frontend Transport; Wed, 10 Jun 2020 06:15:48 +0000 Received: from MN2PR02MB6447.namprd02.prod.outlook.com ([fe80::5822:7dbf:5e6e:3504]) by MN2PR02MB6447.namprd02.prod.outlook.com ([fe80::5822:7dbf:5e6e:3504%4]) with mapi id 15.20.3066.023; Wed, 10 Jun 2020 06:15:48 +0000 From: Dan shmidt To: "pgsql-general@postgresql.org" Subject: Re: Logical replication stuck in catchup state Thread-Topic: Logical replication stuck in catchup state Thread-Index: AQHWPp4kMnTYgcypaUuIn5qFoHT3eqjRXu9/ Date: Wed, 10 Jun 2020 06:15:48 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:09FA9006B63E43C8F12C9CF1030C0DCBEC48845B47D0E1B3DD8C0905F056CA06;UpperCasedChecksum:FDE8A1F47EB5CE2C74F896FAEDE011C3D841C24170B2644936E87793C95421D6;SizeAsReceived:6935;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [yO+IoXHUKQe8zOV5VkwB/+5ZrKDqjZVt] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: d957d0a6-0667-46b1-7f73-08d80d05b7d9 x-ms-traffictypediagnostic: BN8NAM11HT093: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lS7jkjRESJQ5llsOzzvbnk2DTtNQ6U60+Hzc1iOhFfZao0l1iVkgaEChcBrkrk3x4rk3spO9xZW70tdYS37KRZDw6+XVjwAOW/dPLE/Atrd4y0VWoqJQe95n4b3sbnUvOOGDkVbFBEnb3ukqXIU0WrlZxnUYrpKX9PFBytYhSGAZomTnU9LMFwoiOsvJnjQcw6EHz/82Jzh6gKSsstF335ttpZaqHxaFLrOKdSYqvAhverdwJFppbzDPLICWdlye x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR02MB6447.namprd02.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-antispam-messagedata: RRpvhqqpvVriYoSheRD4OaXRcbWZxTTMoTS7+EkCnd1cVXpab4vtUiU7/csAgVIQ15bDkbYaJNhEe7KLDOKY+BwqMH3KfDCExkkQr8oLIIq561Ba+JTPhlaSCph4z35uaqeqARCrHuITuVT7xm+yfg== x-ms-exchange-transport-forked: True Content-Type: multipart/alternative; boundary="_000_MN2PR02MB6447F56F5D85F758D8DD5436A4830MN2PR02MB6447namp_" MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: d957d0a6-0667-46b1-7f73-08d80d05b7d9 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2020 06:15:48.2647 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM11HT093 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_MN2PR02MB6447F56F5D85F758D8DD5436A4830MN2PR02MB6447namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thank you very much for your replies. Regarding the server logs, I didn't find anything but healthy log when the = server start which says that it is going to recover from the same point in = WAL which was last sent. Regarding bugfixes, I will try to update ASAP - but wouldn't a restart of t= he server release the lock? Is there a way to release the lock manually? Any other suggestion on how to recover from this state without upgrading? Is there a way to restart the replication from scratch? Sent from Outlook ________________________________ From: Dan shmidt Sent: Wednesday, June 10, 2020 12:30 AM To: pgsql-general@postgresql.org Subject: Logical replication stuck in catchup state Hi All, We have a setup in which there are several master nodes replicating to a si= ngle slave/backup node. We are using Postgres 11.4. Recently, one of the nodes seems to be stuck and stopped replicating. I did some basic troubleshooting and couldn't find the root cause for that. On one hand: - the replication slot does seem to be active according to pg_replication= _slots (Sorry no screenshot) - on slave node it seems that last_msg_receipt_time is updating on pg_sta= t_subscription On the other hand: - on the slave node: received_lsn keeps pointing on the same wal segment (= pg_stat_subscription) - redo_lsn - restart_lsn shows ~20GB lag According to logs on the master it seems that the sender hits a timeout, wh= en trying to increase the wal_sender_timeout even to 0 (no timeout) - it do= esn't have any effect. On the other hand, the last_msg_receipt_time is upd= ated. How is that possible? Screenshots attached. The stuck subscription/replication slot is the one en= ding with "53db6". On images with more than one row - it's the second one. Any suggestions on what may be the root cause or how to continue debugging? Appreciate your help. Thank you, Dan. --_000_MN2PR02MB6447F56F5D85F758D8DD5436A4830MN2PR02MB6447namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Thank you very much for your replies.

Regarding the server logs, I didn't find anything but healthy log when the = server start which says that it is going to recover from the same point in = WAL which was last sent.
Regarding bugfixes, I will try to update ASAP - but wouldn't a restart of t= he server release the lock? Is there a way to release the lock manually?&nb= sp;

Any other suggestion on how to recover from this state without upgrading?&n= bsp;
Is there a way to restart the replication from scratch? 

Sent from Outlook


From: Dan shmidt
Sent: Wednesday, June 10, 2020 12:30 AM
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>= ;
Subject: Logical replication stuck in catchup state
 
Hi All,

We have a setup in which there are several master nodes replicating to a si= ngle slave/backup node. We are using Postgres 11.4.
Recently, one of the nodes seems to be stuck and stopped replicating.
I did some basic troubleshooting and couldn't find the root cause for that.=

On one hand:
  - the replication slot does seem to be active according to pg_replic= ation_slots (Sorry no screenshot)
  - on slave node it seems that last_msg_receipt_time is updating on p= g_stat_subscription

On the other hand:
 - on the slave node: received_lsn keeps pointing on the same wal segm= ent (pg_stat_subscription)
 - redo_lsn - restart_lsn shows ~20GB lag
 
According to logs on the master = it seems that the sender hits a timeout, when trying to increase the&= nbsp;wal_sender_t= imeout even to 0 (no timeout) - it doesn't have any effect. On the other hand, the&nbs= p; last_msg_receipt_time is= updated. How is that possible? 

Screenshots attached. The stuck subscription/replication slot is the one ending with "53db6= ". On images with more than one row - it's the second one.


Any suggestions on what may be the root cause or how to continue debugging?<= /div>
Appreciate your help.

Thank you,
Dan.


--_000_MN2PR02MB6447F56F5D85F758D8DD5436A4830MN2PR02MB6447namp_--