From: Paul Förster <paul.foerster@gmail.com>
To: Stephen Frost <sfrost@snowman.net>
Cc: James Sewell <james.sewell@jirotech.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Safe switchover
Date: Mon, 13 Jul 2020 17:54:57 +0200
Message-ID: <E3416778-D8E9-4573-952B-BC7D563017F2@gmail.com> (raw)
In-Reply-To: <20200713154722.GU12375@tamriel.snowman.net>
References: <CAANVwEv6Ttv0p74P0U8DemFdYejC=VRX2xvFA-nPHTZk=v-12Q@mail.gmail.com>
<CAANVwEu1AoiMe9ao0adaNjfW4TTT5ay7VoRUL6+9He18jg-ugQ@mail.gmail.com>
<7E43945E-4571-4D30-9E8F-B940B9277DEF@gmail.com>
<20200710152959.GK12375@tamriel.snowman.net>
<01BE6868-6920-4E5D-9A4D-838E3036DCD2@gmail.com>
<20200710154556.GL12375@tamriel.snowman.net>
<CB2A7C50-8629-4C14-94DA-DA3C51C669C3@gmail.com>
<20200713154722.GU12375@tamriel.snowman.net>
Hi Stephen,
> On 13. Jul, 2020, at 17:47, Stephen Frost <sfrost@snowman.net> wrote:
>
> Sure, Patroni will handle the failover fine- but that's not what I was
> referring to. If the server crashes and you have no idea why or what
> happened, I would strongly recommend against using pg_rewind to rebuild
> it to be a replica as there's no validation happening- you might
> failover to it much later and, if you're lucky, discover quickly that
> some blocks had gotten corrupted or if you're unlucky not discover until
> much later that something was corrupted when the crash happened. Using
> initdb -k is good, but PG is only going to check the block when it goes
> to read it, which might not be until much later especially on a system
> that's been rebuilt as a replica.
I see your point, yet, I'm not sure how pgbackrest could protect us from such a situation.
> This seems like an independent question and I'm not really sure what is
> meant here by 'reinit it with Patroni'.
reinit basically deletes the replica database cluster and triggers a new full copy of the primary. You can either "patronictl reinit" or kill patroni, rm -r ${PGDATA}, and start patroni. This is basically the same.
> I agree that it'd be good to have -k on by default.
so, now, we're two. :-) Anyone else? ;-)
Cheers,
Paul
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: paul.foerster@gmail.com, sfrost@snowman.net, james.sewell@jirotech.com
Subject: Re: Safe switchover
In-Reply-To: <E3416778-D8E9-4573-952B-BC7D563017F2@gmail.com>
References: <CAANVwEv6Ttv0p74P0U8DemFdYejC=VRX2xvFA-nPHTZk=v-12Q@mail.gmail.com> <CAANVwEu1AoiMe9ao0adaNjfW4TTT5ay7VoRUL6+9He18jg-ugQ@mail.gmail.com> <7E43945E-4571-4D30-9E8F-B940B9277DEF@gmail.com> <20200710152959.GK12375@tamriel.snowman.net> <01BE6868-6920-4E5D-9A4D-838E3036DCD2@gmail.com> <20200710154556.GL12375@tamriel.snowman.net> <CB2A7C50-8629-4C14-94DA-DA3C51C669C3@gmail.com> <20200713154722.GU12375@tamriel.snowman.net> <E3416778-D8E9-4573-952B-BC7D563017F2@gmail.com>
* 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