Re: Behaviour of failed Primary

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Santhosh Kumar <krssanthosh(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Behaviour of failed Primary
Date: 2020-05-21 14:30:50
Message-ID: CAA4eK1+FQppFgaWguLCn6esrBdY6t=6yWW5JtXwTOrAxLWHn5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, May 21, 2020 at 5:38 PM Santhosh Kumar <krssanthosh(at)gmail(dot)com> wrote:
>
> Hi Forum,
> If I have a cluster with Synchronous replication enabled with three nodes, for eg:
>
> [primary] [hot stand by 1] [host stand by 2]
>
> And for some unforeseen reasons, if primary fails, the failover will kick in and hot stand by 1 will become new primary and cluster setup will look like this
>
> [new primary (hot stand by1)] [host stand by 2]
>
> My question here is, what will happen if the original primary which has failed comes back. Will it become part of this high available replica cluster automatically or it will be stale and disconnected from the cluster?
>

It won't become standby automatically as it would have diverged from
the new master.

> How can we automatically make the failed primary to be part of the cluster with hot standby role? It would be of great help, if you can direct me to any references details. Thank you, upfront.
>

I think pg_rewind can help in such situations. See the docs of pg_rewind [1].

[1] - https://www.postgresql.org/docs/devel/app-pgrewind.html

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rory Campbell-Lange 2020-05-21 14:35:59 Strategy for materialisation and centralisation of data
Previous Message postgann2020 s 2020-05-21 14:27:44 Suggestion on index creation for TEXT data field

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2020-05-21 14:45:10 Re: Trouble with hashagg spill I/O pattern and costing
Previous Message Tomas Vondra 2020-05-21 14:30:40 Re: Trouble with hashagg spill I/O pattern and costing