Subject: Failover and Failback

From: "Narendran .j" <[email-masked]>
Date: Thu, 19 Sep 2024 16:46:28 +0530

Hello Team,

I have facing a problem in failback. I just promoted my secondary as master
by using pg_ctl promote.it was successful.so now how can I bring my old
master as primary I tried with pg_rewind it's not working. So is there any
other way to perform failback. Is there any procedure to perform failback
and failover please share with me. Additionally we don't use any tool for
it.

Regards
Narendran J

---

From: Michael Banck <[email-masked]>
Date: Thu, 19 Sep 2024 13:32:54 +0200

Hi,

On Thu, Sep 19, 2024 at 04:46:28PM +0530, Narendran .j wrote:
> master as primary I tried with pg_rewind it's not working. 

You need to bring your old primary as standby first, then switchover
back to it - otherwise, you would have two primaries, no?

In general, pg_rewind is the only reasonable way to recover a failed
over primary other than by rebuilding it from scratch as a standby.

So if pg_rewind did not work, we would need more information, like what
command did you issue exactly and what was the output/error message?

Michael

---

From: sethu mathavan <[email-masked]>
Date: Thu, 19 Sep 2024 17:05:06 +0530

Hi Narendran,

Before running rewind command,need to change few parameters in
postgresql.conf file.like primary_conninfo in old_master.

Regards,
Sethu

On Thu, 19 Sep, 2024, 4:46 pm Narendran .j, <[email-masked]> wrote:

> Hello Team,
>
> I have facing a problem in failback. I just promoted my secondary as
> master by using pg_ctl promote.it was successful.so now how can I bring
> my old master as primary I tried with pg_rewind it's not working. So is
> there any other way to perform failback. Is there any procedure to perform
> failback and failover please share with me. Additionally we don't use any
> tool for it.
>
> Regards
> Narendran J
>