Finding the synchronous slave after a master crash

Поиск
Список
Период
Сортировка
От Sam Crawley
Тема Finding the synchronous slave after a master crash
Дата
Msg-id 51C140BA.1060003@catalyst.net.nz
обсуждение исходный текст
Список pgsql-general
Hi,

I was just wondering if there was a reliable way to find the synchronous
slave if the master has crashed and is uncontactable. I believe the
recommended way to find the new master in this situation is to poll the
slaves, looking at the output of pg_last_xlog_replay_location(), and
find which is the most up-to-date.

However, this doesn't work if one or more of the slaves are also
uncontactable (an obscure, but not entirely unreasonable scenario). In
this case, we can't tell whether the uncontactable slave is actually the
most up-to-date (presumably because it was the most recent synchronous
slave), so can't be sure we have selected the correct new master.

This problem could easily be side-stepped if we knew which was the most
recent synchronous slave (and could query that from the slaves, as the
master is no longer contactable). We could then be sure that a new
master could be correctly selected (or that the synchronous slave is
also uncontactable, meaning we can't promote a new master without
risking data loss). Is there some mechanism for finding this that I've
missed, or some other way around this problem?

Thanks,
Sam Crawley.


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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: json functions
Следующее
От: sachin kotwal
Дата:
Сообщение: Migration from DB2 to PostgreSQL