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 1pFr72-0007FI-QY for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Jan 2023 06:30:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pFr71-0004Lp-EW for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Jan 2023 06:30:55 +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 1pFr71-0004Lg-4n for pgsql-hackers@lists.postgresql.org; Thu, 12 Jan 2023 06:30:55 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pFr6u-0008EP-Ea for pgsql-hackers@postgresql.org; Thu, 12 Jan 2023 06:30:54 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 0F7F03200999; Thu, 12 Jan 2023 01:30:45 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 12 Jan 2023 01:30:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc: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=fm3; t=1673505045; x=1673591445; bh=ZjnLVFn1vm JDuaGnQPioTM32Nr6OfkvSCckCQn5831U=; b=CvtPHVgtWbmgVbiSWNt7Z2VzHe YZGmSnU5XkL1KbY6yr0/+heeMV7BMlzxkBxY3WwugYn/OjDbt4PXNJmDb7liqzQt n1nmzqQxStrGNl0AIf5g6wJNIUzfBiQ3fQ2m6IxkVuVPRrr2FSBdVMjg9sUZNxuD AlnbtAaL/ahgyDS6UjgS7kGgtGIkL5o9hS++xCwOwQ+ZaFsPtKuDt3QRHV25jwkf qdUP66XE6XXCv2Vb6lW+cCN0KmmKvN1QBGJFnNHbcsSCRHMHqUp8mp8G4XhQE0cG I75n2nfGZ5YEwGFmKTT6W/C5YZNrAM1xAaUcBBpd2X9AZQ1HERgf+Fib4QNQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= fm3; t=1673505045; x=1673591445; bh=ZjnLVFn1vmJDuaGnQPioTM32Nr6O fkvSCckCQn5831U=; b=D7PDIxwd/+Alxjd2jiJkVJwhqxse4G7DLXx48pn/D8F1 /uWZpy8AlRYCfdTzstT2ElenbILk44XLxNMSQ2MXDXPk/Z/NaWaL8os/HAnzYoQh xXrOHLHpLamS5UafLyYcoOgnJOzfyHJKZiz3aW6Dspc5ysYOsNRSiFpvKvOe3B1G WDnNHUyEot0BQYEd8cq6LpAfJVvjdj1KkQyT3Z3QuZVTOfZOlOYEI8/qSCO+zpWH 18h9FpJVPZ9PhPURrTrSbiZvKVwV+czsrUGXHuP7YPQnDpVDyjg49Y7YRSIWLNd6 a9TgafqVqy8hyyJSwrkmLAINJOaiirXzxxyTubU/YA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleehgdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Jan 2023 01:30:43 -0500 (EST) Date: Thu, 12 Jan 2023 15:30:40 +0900 From: Michael Paquier To: Nathan Bossart Cc: Andres Freund , pgsql-hackers@postgresql.org Subject: Re: recovery modules Message-ID: References: <20221227192449.GA3672473@nathanxps13> <20221227221111.xjw5hc3fqzt773gu@awork3.anarazel.de> <20221229194326.GA296099@nathanxps13> <20230103175917.GA204418@nathanxps13> <20230103190538.GA287415@nathanxps13> <20230111192901.GA1955161@nathanxps13> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mqq342nMs5gbc+qX" Content-Disposition: inline In-Reply-To: <20230111192901.GA1955161@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --mqq342nMs5gbc+qX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 11, 2023 at 11:29:01AM -0800, Nathan Bossart wrote: > I'm having trouble thinking of any practical advantage of providing the > redo LSN and TLI. If the main use-case is removing older archives as the > documentation indicates, it seems better to provide the file name so that > you can plug it straight into strcmp() to determine whether the file can be > removed (i.e., what pg_archivecleanup does). If we provided the LSN and > TLI instead, you'd either need to convert that into a WAL file name for > strcmp(), or you'd need to convert the candidate file name into an LSN and > TLI and compare against those. Logging was one thing that came immediately in mind, to let the module know the redo LSN and TLI the segment name was built from without having to recalculate it back. If you don't feel strongly about that, I am fine to discard this remark. It is not like this hook should be set in stone across major releases, in any case. > I initially created a separate basic_restore module, but decided to fold it > into basic_archive to simplify the patch and tests. I hesitated to rename > it because it already exists in v15, and since it deals with creating and > restoring archive files, the name still seemed somewhat accurate. That > being said, I don't mind renaming it if that's what folks want. I've done that in the past for pg_verify_checksums -> pg_checksums, so I would not mind renaming it so as it reflects better its role. (Being outvoted is fine for me if this suggestion sounds bad). Saying that, 0001 seems fine on its own (minus the redo LSN/TLI with the duplication for the segment name build), so I would be tempted to get this one done. My gut tells me that we'd better remove the duplication and just pass down the two fields to shell_archive_cleanup() and shell_recovery_end(), with the segment name given to ExecuteRecoveryCommand().. -- Michael --mqq342nMs5gbc+qX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmO/qRAACgkQnvQgOdby QH3LiQ/+KlQ3ChTMTcRE7xVuoOjcc3kQRJw+KQkOuaVivvMlgM4OAuF6bF+zGcb/ RevkJHVCU2a02XPubR9OKn7glBCNYzxvIpfRidznGf+fzOj9naV04/Ynxm6I1TBV ut4d8qW/os+v1Ijj4/Z0EujrxAxzeBf2qawohB53k3ZKoDSUmOSGOQHzdV7Lw34b kk1ASibrJxsiHPwSDwRCvIp1QxQRRWoeUmoSOVg8L+WOVx6x+SrNZOxiUESPGdcE EtHm9jQCIm+1MGV9bKvP64gimF15cShlV3eGQxkZFWfjUjerOz3lsTA2X+46bWQu xcvYwaZNYhPhG++lud1XvJm0cWF4atGKNF0hiyYtjov7MtOeu3QnfkEVcMwxDWqb i8wOVNypzSpKcmtC2cTZAWlroewfSHfCUjH2DWeSLo+Frrw7sb1LboGrOH1KCAhd Vk7uUqFPAW66KCyzTPZ/JWHyfU86AWVR3w4EeWd6m18HzViJc/t+nOl1JBiDFgWI iVWxn3mLWm/7W3kAQVGliMcjhbkGBEIGxcN/LPYNgKiM4dRKuZjAqcDH3ksMBDYf 5ad4RPurM3fmlgwhkABrd+iOgl95R8bW2cOT9mZZvbt0tsZ/KkjfpspRGbD1ZFxE fibGJG2YwJrRB0y6bNvcVHHtyBnkv/uFgoihKygLB+5dPBC8CaQ= =23/4 -----END PGP SIGNATURE----- --mqq342nMs5gbc+qX--