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 1o5m2i-0000bi-SA for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jun 2022 10:32:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o5m2g-0007a5-Vr for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jun 2022 10:32:30 +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 1o5m2f-0007Zv-KL for pgsql-hackers@lists.postgresql.org; Mon, 27 Jun 2022 10:32:30 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o5m2Y-0000ms-9R for pgsql-hackers@postgresql.org; Mon, 27 Jun 2022 10:32:29 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D82A65C017D; Mon, 27 Jun 2022 06:32:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 27 Jun 2022 06:32:19 -0400 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=fm2; t=1656325939; x=1656412339; bh=7ULwiQu6Wo hYzYmKLG7g/ZXWmnTPFRNLA4WtSuobHUI=; b=PK7peR/8XThMhV1TCzk495Hxq7 lRqJ2laWYP2VywTt5ZS4RgKX0dsTHMHyS6TYRIVZyzQePi96mgPub0eZX+/z9fNg BtvkMtgeCPqhksDja2VAnsbJobHCzszzw4PPR9y+KQS/N3EIzGN8I9QvdhpPL4ry 44Yi+1NLOyvZ7WqW/XlN6pmUFQW2sNpWRbqi0jRJC/DX9G2enNoDw0aEnTfn8rOP Wiwtjb7omreqwGUjYHPHNsvDcVMQAGEd81GzN/30zJoDWSc6wx6rWh9PLFrxymhR vTFkVA6HJDL3Yfs4VOz3JI3/DvfJbTYHzs5vFJeWNdYJb39npfMlGJqjfDjA== 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= fm2; t=1656325939; x=1656412339; bh=7ULwiQu6WohYzYmKLG7g/ZXWmnTP FRNLA4WtSuobHUI=; b=bYwQ7eiR+lZCvtNkvZuv+vPWr3Uafb1PZJnwazilUlJS tPkzPH5q4ld3dmOn4MCZ17IyM88SQaIcAfapYaa8YSQfrCxOHjgwqS8JJJiEg7GD YkN6Z7MK9B/+JsLoLs2GwHUjVaepxcJXdrmkYj+8KT8SSte+N2PMd7GwaMu4scp3 lB3RL6WA/Dd0o2Bqi1vZwRdTArG0Fup/DXGJGKlr+5EwhzjEIjcb2h3Oo27dpluo MftFiANh4b/wzQ6z5HjjNOMTRNoh+8K2Tg0mTXoOON6of4BnPeznyfQrqgqOQ2pz EMqKf3jnxM31NR2YFPOjS2I532nRMjQ4R0VxSuTf/Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeghedgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Jun 2022 06:32:17 -0400 (EDT) Date: Mon, 27 Jun 2022 19:32:08 +0900 From: Michael Paquier To: Noah Misch Cc: Heikki Linnakangas , Tom Lane , pgsql-hackers Subject: Re: last_archived_wal is not necessary the latest WAL file (was Re: pgsql: Add test case for an archive recovery corner case.) Message-ID: References: <2842251.1644849700@sss.pgh.pa.us> <8f15e602-337e-fbb2-4b2e-e83a01ef9088@iki.fi> <831b6ab9-45d6-7ab0-ea9c-6efd4383afb8@iki.fi> <3186114.1644960507@sss.pgh.pa.us> <40de25aa-2e20-08ad-e014-edb731594a74@iki.fi> <20220627070457.GA2176699@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ejpa/eK8iNP70Exb" Content-Disposition: inline In-Reply-To: <20220627070457.GA2176699@rfd.leadboat.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ejpa/eK8iNP70Exb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 27, 2022 at 12:04:57AM -0700, Noah Misch wrote: > For me, it reproduces consistently with a sleep just before the startup > process exits: Nice catch. > One can adapt the test to the server behavior by having the test wait for= the > archiver to start, as attached. This is sufficient to make check-world p= ass > with the above sleep in place. I think we should also modify the Postgre= sNode > archive_command to log a message. That lack of logging was a obstacle > upthread (as seen in commit 3279cef) and again here. ? qq{copy "%p" "$path\\\\%f"} - : qq{cp "%p" "$path/%f"}; + : qq{echo >&2 "ARCHIVE_COMMAND %p"; cp "%p" "$path/%f"}; This is a bit inelegant. Perhaps it would be better through a perl wrapper like cp_history_files? > An alternative would be to declare that the test is right and the server = is > wrong. The postmaster knows how to start the checkpointer if the checkpo= inter > is not running when the postmaster needs a shutdown checkpoint. It could > start the archiver around that same area: >=20 > /* Start the checkpointer if not running */ > if (CheckpointerPID =3D=3D 0) > CheckpointerPID =3D StartCheckpointer(); > /* And tell it to shut down */ > if (CheckpointerPID !=3D 0) > { > signal_child(CheckpointerPID, SIGUSR2); > pmState =3D PM_SHUTDOWN; > } >=20 > Any opinions between the change-test and change-server approaches? The startup sequence can be sometimes tricky. Though I don't have a specific argument coming into mind, I would stick to a fix in the test. -- Michael --ejpa/eK8iNP70Exb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmK5hygACgkQnvQgOdby QH3lqw/+L2XvWd4bXS2OFrpuid9xWlCGomWGOcazU9xaPGx0RFW08RuGfjglRVHu VJs8La+9mHBdGxuNauYQB5osvK/VPpvD//XgV8wmn83McHLmEymGhKPA5FOIAZ3i Msc4aWQfX4qsI0/4YDePYP+hPgECs9/Lt8b5n5/EdT5G4Q2Eu/Sw9exDQB/EsZcE wOS+BF660Nwd7HOwsqKjsYUvJDD66PYZVAkckiQ1F3hT015aSd7GUy9FwgxwHoHV KfCdyk+/kxe471K2a4vwvfNBgQJxQBZDwjiepxWr7vvuTM1SZ3w4ZN8x2mwBQ6le t5PNBwD6jAdVrtkZs935xx0CYTyaJHq/HIr5gwULMFZKaDnh0dkm4EqaHwqEapNq HFZA6/81oJ2/SuvE6EgsYgq1KGA3D6iC9/vgiSOfdKs25ZvsAyZXrUXLVdaD0XXx WoJXZ/4Q6E9JNEAaKZWHLvaSoSkAYC9RvzIgjeZaEUgGL8aEvy3hTqzD01fvSOqF jtB1uC7VBZHvr55pZe4QE7GWeqNhnAQw8eQpS4gNY7e6ypxnfjzNsItZECZU3/bg Vrnii3jZuwQm+n5ZUuYfRoS9YcOfibCvlDKmrCixAeJSe8y04dJNJGOF6Oz5WVzr qFRnYxKtelbsI8CXRuF5Nev5NAfYxbpj9kSioLHlnmxhNWWT00g= =LNeb -----END PGP SIGNATURE----- --ejpa/eK8iNP70Exb--