Search Postgresql Archives

Finding the synchronous slave after a master crash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux