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 1q9zEq-0005fh-Hy for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Jun 2023 02:31:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q9zEp-0006t7-HR for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Jun 2023 02:30:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q9zEo-0006aF-22 for pgsql-hackers@lists.postgresql.org; Fri, 16 Jun 2023 02:30:59 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q9zEE-002SAb-IR for pgsql-hackers@lists.postgresql.org; Fri, 16 Jun 2023 02:30:25 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 287DD5C0163; Thu, 15 Jun 2023 22:30:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 15 Jun 2023 22:30:21 -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=fm2; t=1686882621; x=1686969021; bh=qP apHLxPH/PYNKIZW+0DA0Ie9TBV5MD9d8deX0cZtu4=; b=tI4WjxFU45iwlLldE4 JqAnvylQ5UzWa1YZ7Nu1lPmSEC3uGzcLpeWlCsScVBpZNTjelCiYLoak2/+2tXLu 2VJ51ADxwrHQdskeCZDtw0Pg5vUS+9wAMVNFG+8QonQ/EaFuc/0FmGViRKAqsGI9 5jQplMZPu+mr8HFAVfdBQpJ0MLRKKUvOWxe+eoMkp6X08uhBfnfHudpoHQMteOsn R5p08ZI/yaL0mKXdYEbnMKqplnMCWm3HJ4N15A7d1DwLz9EPZ10E5ehRTJIjG5T0 ATagcXq0rcBRkrLnOPQ6u3yJ6ql5WqcQVscSKHPW4pW8J88OFXm6JPtzlo9s9j/0 guPw== 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=fm2; t=1686882621; x=1686969021; bh=qPapHLxPH/PYN KIZW+0DA0Ie9TBV5MD9d8deX0cZtu4=; b=TGHi7KvlK5+Www7F+Nh9OKO4rxLxg hLfH+2in/lncBGNdBeyYLNDl4x+sQXW0lDz3XNdV1pBlRIOAqxuslgV6L0QR3hMV I+caoGNlAS9esb4SSMBqlUCWO17rTxDF9DpAfLzvCErvyHQ8nN4W/v/iOP6RwELn +HtVofGbM5/s5bQc1rQPMLn4oJ6HuGvUM/fY4CviQZNp2TH0Ka8ByaPk9A+aaw99 MQ7WWKOTndE5CRX2L3U7x+S/XzgNNW5RZl6PsGl5i+HEDRNcjDBVSnWrrJxPIgfG 8mgJAI45Rqj2NHhzGdx1FYKmMlIvwHpb9XvfDaijbIvgLl9gdDlbWynFg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedvfedgieduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepteelieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitg hhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 15 Jun 2023 22:30:19 -0400 (EDT) Date: Fri, 16 Jun 2023 11:30:15 +0900 From: Michael Paquier To: Kyotaro Horiguchi Cc: bharath.rupireddyforpostgres@gmail.com, alvherre@alvh.no-ip.org, andrew@dunslane.net, pgsql-hackers@lists.postgresql.org Subject: Re: Add a perl function in Cluster.pm to generate WAL Message-ID: References: <20230615.134015.1421242753635015365.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5JIAoSaMEyP3I27a" Content-Disposition: inline In-Reply-To: <20230615.134015.1421242753635015365.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --5JIAoSaMEyP3I27a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 15, 2023 at 01:40:15PM +0900, Kyotaro Horiguchi wrote: > + "CREATE TABLE tt (); DROP TABLE tt; SELECT pg_switch_wal();"); >=20 > At least since 11, we can utilize pg_logical_emit_message() for this > purpose. It's more lightweight and seems appropriate, not only because > it doesn't cause any side effects but also bacause we don't have to > worry about name conflicts. Making this as cheap as possible by design is a good concept for a common routine. +1. > - SELECT 'finished';", > - timeout =3D> $PostgreSQL::Test::Utils::timeout_default)); > -is($result[1], 'finished', 'check if checkpoint command is not blocked'); > - > +$node_primary2->advance_wal(1); > +$node_primary2->safe_psql('postgres', 'CHECKPOINT;'); >=20 > This test anticipates that the checkpoint could get blocked. Shouldn't > we keep the timeout? Indeed, this would partially invalidate what's getting tested in light of 1816a1c6 where we run a secondary command after the checkpoint. So the last SELECT should remain around. > -$node_primary->safe_psql( > - 'postgres', "create table retain_test(a int); > - select pg_switch_wal(); > - insert into retain_test values(1); > - checkpoint;"); > +$node_primary->advance_wal(1); > +$node_primary->safe_psql('postgres', "checkpoint;"); >=20 > The original test generated some WAL after the segment switch, which > appears to be a significant characteristics of the test. Still it does not matter for this specific case? The logical slot has been already invalidated, so we don't care much about logical changes in WAL, do we? -- Michael --5JIAoSaMEyP3I27a Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmSLyTcACgkQnvQgOdby QH10FBAAnnMiHtuA1ZgtfcYAbe+RJ4Q6i2eY9Y9o3T0zJJ02KxTnMrZ2r/l8ZcXt ZdzoqsqcH/NB7Ksw0apyAJftx3iZ28RQSaXIfDwKd5yguX35zM7GWuy6LVYFszr+ UxHxDOL2Y802jCF1oNnVeqiWrH05dp9pfBgusEUL5sDKM/zEue7JnTrcHmJhvLKX zT67a4QOs8iyl5HMRoqF3NTwBCIPsrsTw04BPrHgejXmtPaPYPw/nY5rglzcsQfW T/O4b/XTI1DZlBUN4VJNoBpxGBrgvpPyZtdOOo6xpg7bSEpq+U9I4a2mQZq982Fm D38Qp7sgHfPO7yXSj2S2iBzjP7vGpcD4OnnERXKOe0+quwm8gkGLVyU9u1KikEpy OiUCgDWqoBtIHcqVJlc00pUwy58ChEjiJvSOGm5y9IK3WfbzC+lPdfzbEBbig+Yp LxNfXQLwmx4qa1zjuemcgU6fKj4VVny3Lm+hMFixrSyXypQ0E5Ugb3TiVqd+3N4s 3F2e236wILTSjsO74wsaDTbYj6ep7qMqxOxrLcleDa34D6qW46ySnUPtc8446lOe irXJvaiw3SP+4sP8SRfZJk4KsDTrB3CX18NbZfreo93Z0x/fTo09iNPpvIR5HTjx nWFfk8sYiVx+0eo25pvukLi52rQerEXHNQ+hwUuXQuwS5n4heog= =bdAY -----END PGP SIGNATURE----- --5JIAoSaMEyP3I27a--