From: Mariya Rampurawala <Mariya.Rampurawala@veritas.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: PostgreSQL-12 replication. Check replication lag
Date: Tue, 4 Aug 2020 15:23:22 +0000
Message-ID: <AF8F0BC2-E663-4F1E-8ACA-6ABAE3E13B6B@veritas.com> (raw)
Hi,
I am working on providing HA for replication, using automation scripts.
My set up consists of two nodes, Master and Slave. When master fails, The slave is promoted to master.
In case of sync replication, we do not check if the data is up-to-date on slave.
But in case of async replication, how can we check if the slave is up-to-date.
One way I found from the blogs is to compare the values of pg_last_wal_receive_lsn() and pg_last_wal_replay_lsn()
If these values are same, can we say that the slave is up-to-date?
Both these values I will fetch from the slave node. How will the slave ensure it is up-to-date, if the network between master and slave is broken?
Regards,
Mariya
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: Mariya.Rampurawala@veritas.com
Subject: Re: PostgreSQL-12 replication. Check replication lag
In-Reply-To: <AF8F0BC2-E663-4F1E-8ACA-6ABAE3E13B6B@veritas.com>
References: <AF8F0BC2-E663-4F1E-8ACA-6ABAE3E13B6B@veritas.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