pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [patch] demote
Date: Fri, 19 Jun 2020 01:55:35 +0900
Message-ID: <e0c986b5-921f-4dff-97c0-eb298aa9196c@oss.nttdata.com> (raw)
In-Reply-To: <CA+TgmoagXhAERpYG=Kc1keEtg_2xj8ySN+A4Yv1EMYTm3w5Bdw@mail.gmail.com>
References: <20200617174451.222078b4@firost>
	<CA+TgmoaZ28PXLC1j3SBm=NCNOnS0ieThZJ7vKVp4yfdSvBKnZA@mail.gmail.com>
	<2eb2fd8f-c9a0-ac31-66dc-2c56dd048540@oss.nttdata.com>
	<CA+TgmoagXhAERpYG=Kc1keEtg_2xj8ySN+A4Yv1EMYTm3w5Bdw@mail.gmail.com>



On 2020/06/19 0:22, Robert Haas wrote:
> On Thu, Jun 18, 2020 at 8:41 AM Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
>> ISTM that a clean switchover is possible without "ALTER SYSTEM READ ONLY".
>> What about the following procedure?
>>
>> 1. Demote the primary to a standby. Then this demoted standby is read-only.
>> 2. The orignal standby automatically establishes the cascading replication
>>      connection with the demoted standby.
>> 3. Wait for all the WAL records available in the demoted standby to be streamed
>>      to the orignal standby.
>> 4. Promote the original standby to new primary.
>> 5. Change primary_conninfo in the demoted standby so that it establishes
>>      the replication connection with new primary.
>>
>> So it seems enough to implement "demote" feature for a clean switchover.
> 
> There's something to that idea. I think it somewhat depends on how
> invasive the various operations are. For example, I'm not really sure
> how feasible it is to demote without a full server restart that kicks
> out all sessions. If that is required, it's a significant disadvantage
> compared to ASRO.

Even with ASRO, the server restart is necessary and RO sessions are
kicked out when demoting RO primary to a standby, i.e., during a clean
switchover?

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION





view thread (29+ messages)  latest in thread

Message-ID: <e0c986b5-921f-4dff-97c0-eb298aa9196c@oss.nttdata.com>
Permalink:  ../e0c986b5-921f-4dff-97c0-eb298aa9196c@oss.nttdata.com/
Also on:    postgresql.org/message-id/e0c986b5-921f-4dff-97c0-eb298aa9196c@oss.nttdata.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: masao.fujii@oss.nttdata.com, robertmhaas@gmail.com, jgdr@dalibo.com
  Subject: Re: [patch] demote
  In-Reply-To: <e0c986b5-921f-4dff-97c0-eb298aa9196c@oss.nttdata.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