pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Rita <rmorgan466@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: what to do after a failover
Date: Thu, 9 Jan 2020 13:31:39 +0900
Message-ID: <20200109043139.GI2251@paquier.xyz> (raw)
In-Reply-To: <CAOF-KfiEitz3aTdJybdBvu_-y6oirt4YMmdfLjWGpcWG7+Ed=g@mail.gmail.com>
References: <CAOF-KfiEitz3aTdJybdBvu_-y6oirt4YMmdfLjWGpcWG7+Ed=g@mail.gmail.com>

On Wed, Jan 08, 2020 at 11:06:28PM -0500, Rita wrote:
> I run a master and standby setup with Postgresql 11. The systems are
> identical from a hardware and software setup.  If the master goes down I
> can do a pg_ctl promote on the standby and point my applications to use the
> standby (new master).
>
> Once the original master is online, when is an appropriate time to fail
> back over? And are there any other things besides promote after the
> failover is done?

Make sure that you still have an HA configuration able to handle
multiple degrees of failures with always standbys available after a
promotion.

The options available to rebuild your HA configuration after a
failover depend on the version of PostgreSQL you are using.  After a
failover the most simple solution would be to always recreate a new
standby from a base backup taken from the freshly-promoted primary,
though it can be costly depending on your instance.  You could also
use pg_rewind (available in core since 9.5) to recycle the previous
primary and reuse it as a standby of the new promoted custer.  Note
that there are community-based solutions for such things, like
pg_auto_failover or pacemaker-based stuff just to name two.  These
rely on more complex architectures, where a third node is present to
monitor the others (any sane HA infra ought to do at least that to be
honest).
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (5+ messages)  latest in thread

Message-ID: <20200109043139.GI2251@paquier.xyz>
Permalink:  ../20200109043139.GI2251@paquier.xyz/
Also on:    postgresql.org/message-id/20200109043139.GI2251@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: michael@paquier.xyz, rmorgan466@gmail.com
  Subject: Re: what to do after a failover
  In-Reply-To: <20200109043139.GI2251@paquier.xyz>
  References: <CAOF-KfiEitz3aTdJybdBvu_-y6oirt4YMmdfLjWGpcWG7+Ed=g@mail.gmail.com> <20200109043139.GI2251@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox