PostgreSQL-12 replication. Check replication lag

Поиск
Список
Период
Сортировка
От Mariya Rampurawala
Тема PostgreSQL-12 replication. Check replication lag
Дата
Msg-id AF8F0BC2-E663-4F1E-8ACA-6ABAE3E13B6B@veritas.com
обсуждение исходный текст
Ответы RE: PostgreSQL-12 replication. Check replication lag  ("Ahmed, Nawaz (Fuji Xerox Australia)" <Nawaz.Ahmed@aus.fujixerox.com>)
Список pgsql-general

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

 

В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: 12.3 replicas falling over during WAL redo
Следующее
От: Raj Gandhi
Дата:
Сообщение: Postgres 12 - default value for text column