Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gFmtc-0003Rz-M0 for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Oct 2018 21:10:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gFmta-0006Ek-L0 for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Oct 2018 21:10:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gFmta-0006EE-7j for pgsql-hackers@lists.postgresql.org; Thu, 25 Oct 2018 21:10:22 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gFmtW-000670-Vk for pgsql-hackers@postgresql.org; Thu, 25 Oct 2018 21:10:20 +0000 Received: by mail-wm1-x336.google.com with SMTP id p2-v6so2828223wmc.2 for ; Thu, 25 Oct 2018 14:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=f/H6hkLqqoYC5A85UGSzPsTmzCHxiD50SoRVx49QHww=; b=QL7S/2RCpM7ZpZRhGTwC6MWTzSfcPTOKUANYsLuaaor7B48NOr6MPRfCFfQnfffWM7 IA7GLc6/0pIVufaHh1hIQCtqZ4IW3Nwym/SHdwLAHd5UiPy5hvhUZziWlBXIouFdXsE7 HWapD7zd5Ak+xoLSlCYrFkihm4aXVWNUFFF+gdV7U0koUMJm4/LkOb9uJnk3WkocUQV+ gx/EJjnE7blM02wxXamXJMKTUigo/dPFmb1nHzBIBjmA1sjbPxjsa2Q3w+Qn8DavVL92 b2U+s0jej+3+bqcvseNCuX+lS43zp3PDW/hkUuKYXqwjc0+SuynSVcRkGMznL4BQugAQ bcQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=f/H6hkLqqoYC5A85UGSzPsTmzCHxiD50SoRVx49QHww=; b=GcGOcxhI8QCaVn3AOllHf7OkP/GVCXKI1sFmLw3pfue4PkZbd7ZCKLPr5aZRP4TLLq RiqW3kucJj/mMPYi9RDtJduuBngsvTG7bGQWL/iV+J8dSMujTdn8kwSsHWf2OXX6d3Qz zFakuibMMXKilWCii0xDYnddxR7ws5h57uxAEm49hMPSfWmFsfHNCMVA7T/lquFb4K2b 2c7c18ZbLSIEWOxu84Y4zyfO/YAePDHarDLCsnErbL+TzrA2bca85hSyUsvFpM90xS4X rZfYMOU5TWPEaSERFL+x2/CDU2FgKv/eosE/m+21VQOByeVY5EXGpso71vusxMyZ3rQz TiIQ== X-Gm-Message-State: AGRZ1gLx7dvu6p4JQun8qQBQn8cibaoeIO++6NBh4JiCh/g1YqYfuHRl 4VI/qdfEofYlCSXSKV3PHHZS9dTqHYXJ3zspunWsqTIO X-Google-Smtp-Source: AJdET5e68+BKXooFvxh6QwJ7B4P5pPeyEPYakZPQ6DeiD3xwzCVAdypzGwC4UE2Mwx3D/gVfBCs66OIXVkz/BiHeuRI= X-Received: by 2002:a1c:d9cc:: with SMTP id q195-v6mr3110775wmg.23.1540501815182; Thu, 25 Oct 2018 14:10:15 -0700 (PDT) MIME-Version: 1.0 References: <20181025111551.620c6460@firost> <20181025114557.GB1327@paquier.xyz> <20181025150351.629a68a1@firost> In-Reply-To: <20181025150351.629a68a1@firost> From: Nikolay Samokhvalov Date: Thu, 25 Oct 2018 14:10:02 -0700 Message-ID: Subject: Re: Using old master as new replica after clean switchover To: jgdr@dalibo.com Cc: michael@paquier.xyz, pgsql-docs@lists.postgresql.org, pgsql-hackers@postgresql.org Content-Type: multipart/alternative; boundary="0000000000007848f005791407fe" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000007848f005791407fe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Oct 25, 2018 at 6:03 AM Jehan-Guillaume de Rorthais wrote: > What about logging the shutdown checkpoint on the old master? > On the standby side, we could cross-check it with a function confirming: > 1/ the very last XLogRecord received was the old master shutdown checkpoi= nt > 2/ the received shutdown checkpoint has the same LSN > Additionally, the new instructions in the doc might include recommendation, what to do if we found that shutdown checkpoint wasn't received and replayed by the replica-to-promote. From my understanding, before promotion, we could "manually" transfer missing WAL data from the old, inactive master and replay it on the replica-to-promote (of course, if recovery_command is properly configured on it). Right? By the way, if it looks to me that it might be better to write more than just few sentences, what if it will be a new chapter =E2=80=93 say, "Switchover", next to "Failover". It w= ould also give better understanding to the reading, explicitly distinguishing planned and unplanned processes of master/replica role changes. Regards, Nik --0000000000007848f005791407fe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Oct 25, 2018 at 6:03 AM Jehan-Guillaume de Rorthai= s <jgdr@dalibo.com> wrote:
=
What about logging the shutdown checkpoint on the old master?
On the standby side, we could cross-check it with a function confirming: 1/ the very last XLogRecord received was the old master shutdown checkpoint=
2/ the received shutdown checkpoint has the same LSN
<= br>
Additionally, the new instructions in the doc might include r= ecommendation, what to do if we
found that shutdown checkpoint wa= sn't received and replayed by the replica-to-promote. From my
understanding, before promotion, we could "manually" transfer mi= ssing WAL data from the old,
inactive master and replay it on the= replica-to-promote (of course, if recovery_command is
properly c= onfigured on it). Right?

By the way, if it looks t= o me that it might be better to write more than just few sentences, what if= it
will be a new chapter =E2=80=93 say, "Switchover", = next to "Failover". It would also give better understanding
=
to the reading, explicitly distinguishing planned and unplanned proces= ses of master/replica role
changes.

Rega= rds,
Nik
--0000000000007848f005791407fe--