pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dan shmidt <dshmidt@hotmail.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Logical replication stuck in catchup state
Date: Wed, 10 Jun 2020 06:15:48 +0000
Message-ID: <MN2PR02MB6447F56F5D85F758D8DD5436A4830@MN2PR02MB6447.namprd02.prod.outlook.com> (raw)
In-Reply-To: <MN2PR02MB64478461B0651F7774137B87A4820@MN2PR02MB6447.namprd02.prod.outlook.com>
References: <MN2PR02MB64478461B0651F7774137B87A4820@MN2PR02MB6447.namprd02.prod.outlook.com>

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 the 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<http://aka.ms/weboutlook;

________________________________
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 single 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_stat_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, when trying to increase the wal_sender_timeout even to 0 (no timeout) - it doesn't have any effect. On the other hand, the  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?
Appreciate your help.

Thank you,
Dan.

view thread (4+ messages)

Message-ID: <MN2PR02MB6447F56F5D85F758D8DD5436A4830@MN2PR02MB6447.namprd02.prod.outlook.com>
Permalink:  ../MN2PR02MB6447F56F5D85F758D8DD5436A4830@MN2PR02MB6447.namprd02.prod.outlook.com/
Also on:    postgresql.org/message-id/MN2PR02MB6447F56F5D85F758D8DD5436A4830@MN2PR02MB6447.namprd02.prod.outlook.com

 · 

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: dshmidt@hotmail.com
  Subject: Re: Logical replication stuck in catchup state
  In-Reply-To: <MN2PR02MB6447F56F5D85F758D8DD5436A4830@MN2PR02MB6447.namprd02.prod.outlook.com>
  References: <MN2PR02MB64478461B0651F7774137B87A4820@MN2PR02MB6447.namprd02.prod.outlook.com> <MN2PR02MB6447F56F5D85F758D8DD5436A4830@MN2PR02MB6447.namprd02.prod.outlook.com>

* 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