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 1pFVvr-0000Id-A4 for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jan 2023 07:54:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pFVvq-00031I-3A for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jan 2023 07:53:58 +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 1pFVvo-000319-Ly for pgsql-hackers@lists.postgresql.org; Wed, 11 Jan 2023 07:53:57 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pFVvg-0001hc-BA for pgsql-hackers@postgresql.org; Wed, 11 Jan 2023 07:53:56 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id DE52E5C00E4; Wed, 11 Jan 2023 02:53:45 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 11 Jan 2023 02:53:45 -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=1673423625; x=1673510025; bh=xoy2cKT4eQ n1MpAaTCYYctX07dP+9VxD7BIRZXptK5o=; b=GPJCDkRGJ3kG3FDZLICobnc298 uddgQt02AYAZU5GdBMA0cUqXC9xQQzVU1JORsfV6LdT0I6U/sYdX8S//YZcllDaE IhUHdoB3BAOqapbya4vEJE7wP3ht0KNTYUuCTn2fL0v5/8JZApCbab5MizB8Nmjp l2qEAMcgZx+5eAxd75h0W8RyAIkHEeBuvvIE/+4ZD/8ayBG0uJpMmjHTfjZdvlbn 1VHxQFX86QNdY7QVUSo2CHGPCT38+5clwGH3em/4RQyp7mIEPoLoFjgX+JRKj9SQ h/pGlRAUgP62f1X6eP8uVfHqQth/ZXrzO43jkblH4MwBQUex+iuMIbk4fL0g== 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=1673423625; x=1673510025; bh=xoy2cKT4eQn1MpAaTCYYctX07dP+ 9VxD7BIRZXptK5o=; b=mEUG7vcQhs2r0vp602X2fzD2qlxLHlO+a2v71LVY0iQX NsfjJidFuv+m76Joc+MkXM9GNfXdFUkN57F5gjSsS0jpipg5fa7H9OHw6hyRWivY mTCD5eFOHCZGY+jzcX943jk2ZOTelahGDbW1+sWtqbJBeinHDOCwFwn+4+pvWo7E pHFRNdbccjGz+Q2agR9Msi68y1d80BihpDgnQ3GQDMZ9pjRY+sq3x+SqMvy+2PsE HNP1eXSNOhdkx/k13L+Mk1PwR60qrLdnNprv53wYK51eHBFZkIGZph5b/roM8f6D uzyjOqaEkKouM+Rf1OqBS0C0k4iKzU+4ISbBlO09KQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleefgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Jan 2023 02:53:44 -0500 (EST) Date: Wed, 11 Jan 2023 16:53:39 +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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FkttpnByu3iWk2Q8" Content-Disposition: inline In-Reply-To: <20230103190538.GA287415@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --FkttpnByu3iWk2Q8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jan 03, 2023 at 11:05:38AM -0800, Nathan Bossart wrote: > I noticed that cfbot's Windows tests are failing because the backslashes in > the archive directory path are causing escaping problems. Here is an > attempt to fix that by converting all backslashes to forward slashes, which > is what other tests (e.g., 025_stuck_on_old_timeline.pl) do. + GetOldestRestartPoint(&restartRedoPtr, &restartTli); + XLByteToSeg(restartRedoPtr, restartSegNo, wal_segment_size); + XLogFileName(lastRestartPointFname, restartTli, restartSegNo, + wal_segment_size); + + shell_archive_cleanup(lastRestartPointFname); Hmm. Is passing down the file name used as a cutoff point the best interface for the modules? Perhaps passing down the redo LSN and its TLI would be a cleaner approach in terms of flexibility? I agree with letting the startup enforce these numbers as that can be easy to mess up for plugin authors, leading to critical problems. The same code pattern is repeated twice for the end-of-recovery callback and the cleanup commands when it comes to building the file name. Not critical, still not really nice. MODULES = basic_archive -PGFILEDESC = "basic_archive - basic archive module" +PGFILEDESC = "basic_archive - basic archive and recovery module" "basic_archive" does not reflect what this module does. Using one library simplifies the whole configuration picture and the tests, so perhaps something like basic_wal_module, or something like that, would be better long-term? -- Michael --FkttpnByu3iWk2Q8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmO+awMACgkQnvQgOdby QH3BEA//UGDEPGaZfnKFg6+Ai+Y+Uo1xI9BPBP1yY+XdnV5NPZkkpJoAcBMK8/rG qzLrbhxSo2JFWVOGbNspVIYFDEbVTo/mMHq/QQ0b0g5IGEPnaGzlS3SQjM1hFijF SvT4QgqLJCB3YHKOM0sueJq12amA7ZN46dSIWQ0vLUzQlnENsxQ+NebSr+TPIuKG S4InVMVJh6hOktXx8712Sk1fEhEyuOh911zA/6vNhHL2qRjhrlZ0TfXxNQZ+rkbY idH7hXcTPKXYA2SYBUmzbF10QI6REgFxQ0e9aymN+h9lmGKF0TLKF4rG5VAAYSPZ QWeYxOtnGfFAZwk5nrf1z2ICOrOL9Cfpi7FPAVz1SQfYh/zdz5SyvIQWsqZ/xQoP agxDUVrSVj8NM5/peq4giE0rl73EZ+nW9zdicpjsr4ptJiBP219dNJRN1zl9Prai 1TaJj3PwwY3aXVKcfc+01Hujn/DFNVvxj/pRCR7IA+vs0VsUzcGmSmAU36vJNAdm vgqKDnuBUhUgm9LXsOLwyMeeZAGqsDDYC+BTv5h+3WQQfhkSKlIwgYDVxuDUddzI 8H2I2ULP6cEbUSZ/FXUMOrGajSJ/0EOPgVOn4ynLZhcEPOBQR8HOUsKD9dCoCZqE AJgiuMlJcoWiHCe9ZFaBKHfkFBNFbQbULIgAMW/jr0ohagUZNP8= =U+y9 -----END PGP SIGNATURE----- --FkttpnByu3iWk2Q8--