Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jv0nN-0006wQ-Cm for pgsql-general@arkaria.postgresql.org; Mon, 13 Jul 2020 15:55:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jv0nM-0000P1-CE for pgsql-general@arkaria.postgresql.org; Mon, 13 Jul 2020 15:55:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jv0nM-0000Oq-2j for pgsql-general@lists.postgresql.org; Mon, 13 Jul 2020 15:55:08 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jv0nF-0004Kx-8m for pgsql-general@lists.postgresql.org; Mon, 13 Jul 2020 15:55:07 +0000 Received: by mail-ej1-x643.google.com with SMTP id n26so17823599ejx.0 for ; Mon, 13 Jul 2020 08:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=egCmSdO4DTRZ14zOChNwOdiJnai1etutazTPAiJxu7o=; b=Tx4ir/UrRIxDBPEZUVwvEJ+AVEv1uXljpcjhkf/yc5wu8DSTeLhSUy0bk+75TK/PAf n+JmDegG+KxNUb3THGFRnyy/giYsVpdCn/VJhrAqxhfNms6XfYL7G3JHYuT/Xj7X+g0K 2cQAlHDGrQ8UeIupK6T//lNn+36/3zPQFPwmHMaUZdkh47VFB/EEPhqsMjSqX9idmIAN 959f5RMQfWpMZDsDW33NCPUgmLVmrsqv8U39y06VhgWkiaaCFFVAd02KElllqP//eQP1 9gMsO1dpsiaZou93Tmrpr+om1eMNDH7lajInJs06wMWlmsLVH3SeEcUMl/k8ibQPcQem FRGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=egCmSdO4DTRZ14zOChNwOdiJnai1etutazTPAiJxu7o=; b=htb2UnuNOAmKMGxxFREvRfB9avgdm5tp9tkqrwTrOpgSq3JOAlQUsv3+xB5OuocWng Iu0+EUGOFB+V4uTGik69tV6+BrfQjtnKUpoHzV0t5Q+jlcqNmBg+/NXAadfatXHzsEj7 ssTKI1uL92kzineBnRvxOi76ff0sgAa0/JLDL5tUOMhXKIm8gsFbEWHWH4+JOl6V8MRo ijc1BaSJ3ovD1hzAuyDYDMRhe88SU9Q4AioK+o7ZjvW2H/L04qqRsT0RJEmtsMjgr9wC 3bld/ssRoGbGxkZtYXXfQBzH01VtF48SEkXMBP4Uvdy9HBRjtmR81BIK6uq2lTkAXbwU agHg== X-Gm-Message-State: AOAM5338iHCNYP+2HZ0bJZNmvKRaxqekqAEKzLvdfBz02mJy8F/FMvgt fBIOFhoyGaUYP+ngx28BTvg= X-Google-Smtp-Source: ABdhPJxSfHvW29TPByBR50nBKZ538kMKYfmFDIssZmPy3YqW9tkvpruC8tktB0ho9FE5aVd6TEqPKw== X-Received: by 2002:a17:906:3fd2:: with SMTP id k18mr376327ejj.387.1594655700186; Mon, 13 Jul 2020 08:55:00 -0700 (PDT) Received: from [192.168.1.8] (241-57-239-77.dyn.cable.fcom.ch. [77.239.57.241]) by smtp.gmail.com with ESMTPSA id dm1sm10167764ejc.99.2020.07.13.08.54.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jul 2020 08:54:59 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: Safe switchover From: =?utf-8?Q?Paul_F=C3=B6rster?= In-Reply-To: <20200713154722.GU12375@tamriel.snowman.net> Date: Mon, 13 Jul 2020 17:54:57 +0200 Cc: James Sewell , "pgsql-generallists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <7E43945E-4571-4D30-9E8F-B940B9277DEF@gmail.com> <20200710152959.GK12375@tamriel.snowman.net> <01BE6868-6920-4E5D-9A4D-838E3036DCD2@gmail.com> <20200710154556.GL12375@tamriel.snowman.net> <20200713154722.GU12375@tamriel.snowman.net> To: Stephen Frost X-Mailer: Apple Mail (2.3608.80.23.2.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Stephen, > On 13. Jul, 2020, at 17:47, Stephen Frost wrote: >=20 > 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=