Re: how to perform a manual failover with patroni without applying any outstanding WAL?

From: Muhammad Imtiaz <imtiaz(dot)m(at)bitnine(dot)net>
To: "Zwettler Markus (OIZ)" <Markus(dot)Zwettler(at)zuerich(dot)ch>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: how to perform a manual failover with patroni without applying any outstanding WAL?
Date: 2024-07-12 10:37:25
Message-ID: CANwR1ORhME6_T1KkQTQAHFZtDB-g+ZhYJcETCSYtr5Ku9wq_=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

You can follow these guidelines, and they should be helpful for you.

- Stop the patroni on Primary Node
- Stop the patroni on Standby Node and promote the standby as primary
pg_ctl promote -D "Path to Data Directory"
- Set the primary role in the Patroni configuration file on the new
primary and restart the patroni .

Regards,
Muhammad Imtiaz

On Fri, 12 Jul 2024 at 15:16, Zwettler Markus (OIZ) <
Markus(dot)Zwettler(at)zuerich(dot)ch> wrote:

> We have a simple Patroni config (1 primary + 1 standby).
>
>
>
>
>
> We configured the standby to run 3 hours behind the primary:
>
> + recovery_min_apply_delay: '3h' # standby 3 hours behind
>
> + synchronous_mode: false # asynchron
>
>
>
>
>
> In case there is a logical problem on the primary (wrong data processing,
> misleaded application upgrade,…) we want to perform a manual failover to
> the standby, which still contains the old, correct data status.
>
> That means the standby should __not__ apply any more WALs within the 3
> hour residue in the event of a manual failover.
>
>
>
>
>
> When I tried a "patronictl failover" the standby first applied all
> outstanding WALs (which I don't want) and only then promoted the standby.
>
> Any idea?
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Peter Garza 2024-07-12 11:15:18 Re: Oracle to Postgres
Previous Message Zwettler Markus (OIZ) 2024-07-12 10:15:58 how to perform a manual failover with patroni without applying any outstanding WAL?