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 1l2Q5B-0003nG-7n for pgsql-general@arkaria.postgresql.org; Thu, 21 Jan 2021 02:52:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2Q5A-00040A-6l for pgsql-general@arkaria.postgresql.org; Thu, 21 Jan 2021 02:52:24 +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 1l2Q59-000403-VG for pgsql-general@lists.postgresql.org; Thu, 21 Jan 2021 02:52:23 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2Q57-0007m9-FW for pgsql-general@lists.postgresql.org; Thu, 21 Jan 2021 02:52:23 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1l2Q54-0006KY-II; Wed, 20 Jan 2021 21:52:18 -0500 Date: Wed, 20 Jan 2021 21:52:18 -0500 From: Bruce Momjian To: Ian Lawrence Barwick Cc: Mohamed Wael Khobalatte , Michael Lewis , Atul Kumar , pgsql-general Subject: Re: upgrade using logical replication Message-ID: <20210121025218.GA3646@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Jan 21, 2021 at 10:25:39AM +0900, Ian Lawrence Barwick wrote: > 2021年1月21日(木) 9:19 Mohamed Wael Khobalatte : > > > > On Wed, Jan 20, 2021 at 2:37 PM Michael Lewis wrote: > > Using pg_upgrade takes minutes for an in place upgrade. If you can > allow 1+ hour of downtime, it seems overly complicated to use logical > replication. > > > I suppose the Atul's issue is what to do with the replicas. Once he does > pg_upgrade, then he will need to provision new ones, no? I suppose in this > case logical would be better, with the new instance itself having replicas. > I haven't done it, and it's gonna require some setup time, definitely much > longer than pg_upgrade then make do with one server until your new physical > replicas are set up.  > > > The replicas will need to be set up at some point anyway; with logical > replication the new cluster is ready to go once the new primary is fully > "seeded" (and the new replicas have caught up with that). Switchover can then > take place whenever convenient, with minimal downtime, more time for testing, > and the possibility of switching back if issues are encountered. > > Potential downsides to this approach are that the database schema may need to > be > modified to be suitable for logical replication, and additional resources may > be > needed to host the old and new clusters simultaneously during the migration > process. pg_upgrade docs have instructions on how to upgrade replicas in place using rsync with hard links. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee