Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qe8ao-005qUN-7L for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Sep 2023 06:34:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qe8am-00Fn8V-Aj for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Sep 2023 06:34:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qe8al-00Fn8C-Ut for pgsql-hackers@lists.postgresql.org; Thu, 07 Sep 2023 06:34:15 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qe8ad-003Zpk-5F for pgsql-hackers@lists.postgresql.org; Thu, 07 Sep 2023 06:34:15 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 2F191320076F; Thu, 7 Sep 2023 02:34:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 07 Sep 2023 02:34:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1694068443; x=1694154843; bh=/M goMnct/ZXsEUv6Y1SB7E6lr7TUhCT74OgVYiIBfio=; b=bmI/b6qQA2M88vuxhm 1yIY2sOr9Ij1xtAaAtv+KIlrEzkFmy0dqNdoT1/mFx7kRBOgRDohZB0fetCSEcbK qhkKXNp+x3gqNNDZKHsFC/Gg7YhBPhYPjtfMnW/1js24n1NQcQv3C/k8Avyxc9Pv lu7kmlzg3P8H4oNM3D4dss8bCzahgLa3bnyZSj8Fm9rR56nhDkSOdfDVuAwx2o5v 0xzh+e+mTL9SQeyBc5nBypJDrALn9H8X7Km/g46C1JcettYn+f45K4U0OjgM51CF kKUbceopSSlfM1n/p+AYoOoZ3to4fjHZQM3zSyJJMh40UKcwPBx3O2vl6ASWrvD/ fpHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1694068443; x=1694154843; bh=/MgoMnct/ZXsE Uv6Y1SB7E6lr7TUhCT74OgVYiIBfio=; b=EPbXvaDRPooToEnqDf5XBe2WSq0qn 0mE1KzZQ/RM/uDf54TBx0b97cm1YKYGBEdMvl3iJgtU7gpIP0OflassHeQsQj3qO jBXDoMNiMFQAizXtzhRCiBUOpMEtKy+mUq+N1OtsJyt8sxeu+ONEEXgdF/fZFnNn Hl+QUdJtrPcrSbi5FptKjuxlv2/4AsEvaosa+pl8uMOVjB9Nsi00a2KJ33YLxM4H PK87DV/pscQ+j3G8rxekjZBvn+ACWzwkC7z+vrp97AYGFhEQudKRD2nP7GctFR4W 88hM0vs8HdKMieopI2rN7wLn6Pq75RKpa0BlO0Aby7VAbPVvfFEcWQlWw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehgedgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreer tddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlse hprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeegffejvefgveduvdejtddv tdeijeehudeuledvudeftdfgfeejvdekveekiedvvdenucffohhmrghinhepphhoshhtgh hrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 7 Sep 2023 02:34:01 -0400 (EDT) Date: Thu, 7 Sep 2023 15:33:58 +0900 From: Michael Paquier To: Amit Kapila Cc: Peter Smith , Julien Rouhaud , "Hayato Kuroda (Fujitsu)" , PostgreSQL Hackers Subject: Re: pg_upgrade and logical replication Message-ID: References: <20230327084955.m624nwfaf7mbzo6j@jrouhaud> <20230407022802.jqmdhgjhrnj5lpcl@jrouhaud> <20230424072224.qd3awkfrjcanw2pa@jrouhaud> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="nL+S3qo4L9YkUpDQ" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --nL+S3qo4L9YkUpDQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 04, 2023 at 02:12:58PM +0530, Amit Kapila wrote: > Yeah, I agree that could be hacked quickly but note I haven't reviewed > in detail if there are other design issues in this patch. Note that we > thought first to support the upgrade of the publisher node, otherwise, > immediately after upgrading the subscriber and publisher, the > subscriptions won't work and start giving errors as they are dependent > on slots in the publisher. One other point that needs some thought is > that the LSN positions we are going to copy in the catalog may no > longer be valid after the upgrade (of the publisher) because we reset > WAL. Does that need some special consideration or are we okay with > that in all cases? In pg_upgrade, copy_xact_xlog_xid() puts the new node ahead of the old cluster by 8 segments on TLI 1, so how would be it a problem if the subscribers keep a remote confirmed LSN lower than that in their catalogs? (You've mentioned that to me offline, but I forgot the details in the code.) > As of now, things are quite safe as documented in > pg_dump doc page that it will be the user's responsibility to set up > replication after dump/restore. I think it would be really helpful if > you could share your thoughts on the publisher-side matter as we are > facing a few tricky questions to be answered. For example, see a new > thread [1]. In my experience, users are quite used to upgrade standbys *first*, even in simple scenarios like minor upgrades, because that's the only way to do things safely. For example, updating and/or upgrading primaries before the standbys could be a problem if an update introduces a slight change in the WAL record format that could be generated by the primary but not be processed by a standby, and we've done such tweaks in some records in the past for some bug fixes that had to be backpatched to stable branches. IMO, the upgrade of subscriber nodes and the upgrade of publisher nodes need to be treated as two independent processing problems, dealt with separately. As you have mentioned me earlier offline, these two have, from what I understand. one dependency: during a publisher upgrade we need to make sure that there are no invalid slots when beginning to run pg_upgrade, and that the confirmed LSN of all the slots used by the subscribers match with the shutdown checkpoint's LSN, ensuring that the subscribers would not lose any data because everything's already been consumed by them when the publisher gets to be upgraded. > The point raised by Jonathan for not having an option for pg_upgrade > is that it will be easy for users, otherwise, users always need to > enable this option. Consider a replication setup, wouldn't users want > by default it to be upgraded? Asking them to do that via an option > would be an inconvenience. So, that was the reason, we wanted to have > an --exclude option and by default allow slots to be upgraded. I think > the same theory applies here. >=20 > [1] - https://www.postgresql.org/message-id/CAA4eK1LV3%2B76CSOAk0h8Kv0AKb= -OETsJHe6Sq6172-7DZXf0Qg%40mail.gmail.com I saw this thread, and have some thoughts to share. Will reply there. -- Michael --nL+S3qo4L9YkUpDQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmT5btYACgkQnvQgOdby QH0jPxAAh+GIVXwPoHIiXHS6ZC3wvF92y5QYLaYWLvLnS2M6bvaHlbagKIAS7mBa iE3ILuec/7HEkVgRDgG8doPZFDGZGmkA5ajOtmirdMJgQu9qIt4ZfQBuSQCvYBmM 0qcmGVQIspABnz9xKfj6x5ICf4JD71cY/AZ7V96EVAal4N/Qk1UWo84ez7vLdXfn 5uUeh+gy+5Wdxwz0XFk7+0O+pT6ZTtx+ul0DHDsYju0NGxFLyvpgzvNYxjuOSyAZ 7VZMF2gRJ0i+H66CiPlh1ga3ivXy/FNHvDZtwTGSfWfIypLlJ7RMr9MDgz9Gu66c IUwv+27EumEBzxp+T/LVCVLsuD2Ftr+BrD2rWUluw1qNU1tpg794TLhPnS2LlH1U SWJdz/qPxJWMrdZIGRpGspEcjnjVzIaz4KfENZLGMrfplTDnxAqHksDBhoiBLGG5 arUOlCRmMxTNEtdRGB+YbjWe1729ITzbYSIJGy0O2ViOO7zJ1wbT0l0yYk/WJikA 9Wl0xGq5wG6xLS8rTThyFcrGjGfeFzYFCEI51mxeUfB5FbTZNEVHR/Tw9pNZzuWL BC3SC92+WcJTgNSykqaBXRq23vSYCEhyB9R30OFt/oeCk3KDWJxOrIN8wZLMdWpS zA6ZW+p20UwAGXGqdxmV4O6UtM6pXEcc9n45xzsCGQi5mAoj/yY= =4C3d -----END PGP SIGNATURE----- --nL+S3qo4L9YkUpDQ--