Re: Safe switchover

From: Paul Förster <paul(dot)foerster(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: James Sewell <james(dot)sewell(at)jirotech(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Safe switchover
Date: 2020-07-13 15:54:57
Message-ID: E3416778-D8E9-4573-952B-BC7D563017F2@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Stephen,

> On 13. Jul, 2020, at 17:47, Stephen Frost <sfrost(at)snowman(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2020-07-13 16:00:53 Re: Safe switchover
Previous Message Stephen Frost 2020-07-13 15:47:22 Re: Safe switchover