Re: How to choose new master from slaves.? - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: How to choose new master from slaves.?
Date
Msg-id 20220806084026.cnzhqs3ykuextoyu@hjp.at
Whole thread Raw
In response to How to choose new master from slaves.?  (Sacheen Birhade <sacheen.birhade@veritas.com>)
Responses Re: How to choose new master from slaves.?
List 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!"

Attachment

pgsql-general by date:

Previous
From: "Peter J. Holzer"
Date:
Subject: Re: PostgreSQL 14.4 ERROR: out of memory issues
Next
From: Ron
Date:
Subject: Re: How to choose new master from slaves.?