Re: How to choose new master from slaves.?

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: How to choose new master from slaves.?
Дата
Msg-id 20220806084026.cnzhqs3ykuextoyu@hjp.at
обсуждение исходный текст
Ответ на How to choose new master from slaves.?  (Sacheen Birhade <sacheen.birhade@veritas.com>)
Ответы Re: How to choose new master from slaves.?  (Ron <ronljohnsonjr@gmail.com>)
Список pgsql-general
On 2022-08-04 07:43:28 +0000, Sacheen Birhade wrote:
> I have a very basic question about streaming replication feature of Postgres.
> Let’s assume I have servers A, B, C, D, & E with postgres installed with
> streaming replication as follow:
> A  à  B ( sync replication )
> A  à  C ( async replication )
> A  à  D ( async replication )
> A  à  E ( async replication )
> A is master & rest are slaves.
>
> Now my question is:
> Assume replication link between A & B may/may not stable.

Using sync replication on an unstable link is probably not a good idea.
Every time the link goes down, A freezes. Is this what you want?

> If A goes down, how will I choose my new master from slaves? What are
> criteria to choose new master?

I would prefer B over the others because it is in sync with A, so you
don't lose data. All the other ones might.

Otherwise: For the same reason I would prefer B, I would prefer the one
with the most up-to-date data. But there might be other considerations,
e.g. the network connections (bandwidth and delays) between the
surviving members and the clients.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

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

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: PostgreSQL 14.4 ERROR: out of memory issues
Следующее
От: Ron
Дата:
Сообщение: Re: How to choose new master from slaves.?