Re: [EXTERNAL] RE: PostgreSQL-12 replication. Check replication lag - Mailing list pgsql-general

From Michael Paquier
Subject Re: [EXTERNAL] RE: PostgreSQL-12 replication. Check replication lag
Date
Msg-id 20200806023942.GB16470@paquier.xyz
Whole thread Raw
In response to Re: [EXTERNAL] RE: PostgreSQL-12 replication. Check replication lag  (Mariya Rampurawala <Mariya.Rampurawala@veritas.com>)
List pgsql-general
On Wed, Aug 05, 2020 at 06:36:15PM +0000, Mariya Rampurawala wrote:
> What I want to understand is that, in case of replication link
> failure, there will still be inserts happening at the master
> node. In that case, how will the slave know if it is up-to-date?

It cannot do that by itself, which is why in common HA scenarios you
have a witness host that acts as a monitoring instance for the primary
and the standby so as you limit SPOF issues.  This depends of course
on your application requirements, but you can also leverage things
by using a replication lag in bytes on the primary, and even couple
that with synchronous replication to check when commits are getting
blocked.

IMO, I think that you should try to not reinvent the wheel and use one
of the solutions provided by the community, pg_auto_failover coming
into my mind as one solution for example.
--
Michael

Attachment

pgsql-general by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Check replication lag
Next
From: David Gauthier
Date:
Subject: Can PAF be used to provide zero downtime while primary and backup servers are being patched?