Re: How to test replication without doing a failover

Поиск
Список
Период
Сортировка
От Paul Smith
Тема Re: How to test replication without doing a failover
Дата
Msg-id 25cee62c-70d6-5c7d-def8-0988823e6d39@pscs.co.uk
обсуждение исходный текст
Ответ на How to test replication without doing a failover  (Edwin UY <edwin.uy@gmail.com>)
Список pgsql-admin
On 10/11/2022 14:59, Edwin UY wrote:
How do I test and confirm whether replication is working or not besides depending on just running the SQL below?

select pg_is_in_recovery() ;

select * from pg_stat_replication ;


Is it possible to force/initiate a log transaction and see if that gets replicated or not? I mean for example on Oracle we can do a switch logfile and check if that log gets shipped across and applied on the standby, is there something similar in PostgreSQL?


You can (usually) access the replica in read-only mode

So, what I do is do a transaction on the master and see if it appears on the replica. On a live database that often happens automatically, so I just look at, for instance, the latest entry in a busy table on the master, and check it's the same on the replica. If you do this a couple of times as things change on the master, then you'll know whether or not it's replicating properly


Paul


--

Paul Smith Computer Services
Tel: 01484 855800
Vat No: GB 685 6987 53

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

Предыдущее
От: Edwin UY
Дата:
Сообщение: How to test replication without doing a failover
Следующее
От: Holger Jakobs
Дата:
Сообщение: Re: How to test replication without doing a failover