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 1pRQxR-0004rD-D2 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Feb 2023 05:00:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pRQxP-00052S-U9 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Feb 2023 05:00:51 +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 1pRQxO-00052J-F9 for pgsql-hackers@lists.postgresql.org; Mon, 13 Feb 2023 05:00:51 +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 1pRQxK-0004cx-7l for pgsql-hackers@lists.postgresql.org; Mon, 13 Feb 2023 05:00:50 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 955115C0178 for ; Mon, 13 Feb 2023 00:00:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 13 Feb 2023 00:00:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t= 1676264443; x=1676350843; bh=p+u+HBbEuMM3AnaYsQ5P4SyMi9ydMcgD9K+ HoKr+bDY=; b=cvxjJ/W1Tb16jvRD99AHtR2KyXEZN8vGoKJlmrHO5DvB3INg+W0 WtytYjXupwXGGxHiwP+wN+2ED7kTSNoFlnwxknKcbBF4X0521nZvQNBoWTIk3ni0 xMZeL/hmkMSLrLhVeNF0qBj0K4hmzR9WMelrX2QVOczsBbmiVoMNhEzae31M+lkD hGuIvh4wrIanHjN94LHW40JyuXbJDQHq/E0IEYap5bsRKGZNa9ubQOI8SVWSUocf eB7weF08c1Unet7PKez4P3SN+JmD1jMriqyOFqdSYCW+Uw3zp1utmO7nFiFMoiPL UfOlB2HpkbahOM+dpa/GIq1KGA2dlZ3woew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:mime-version :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=1676264443; x= 1676350843; bh=p+u+HBbEuMM3AnaYsQ5P4SyMi9ydMcgD9K+HoKr+bDY=; b=W kVFs6Myu675VKChtebVownq38f+vNaSVell1XEej3bidg909wmgRMMFZlHU8jota Vt3wZuZc7bjTdMWyVkPZzUPsgMbLqF4PrkYrH21LSHAaZXDyKN7dsnd75MXzaYbG 4svs4+nOm6hv2c8u9Acu6I+dIDYvm/eEAxAcoitFu7BokLJXXxFELD8ZC0ZhAu9R 7IQRTY8BPmUeD2sSr9K3SZ1xsBJE6GnIrcbvgfItF8O19XW0cTmSD7lxQaTFdLqD X4cFgbuP4k7X/go9aD5IpfS231Yl5swaHC4yML8+emOBAlq+msOnAiYyDwORnalX tSNxfSEOvrX7jJpeOysCg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeitddgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvuffkgggtugesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeeihedvveekjeejudduheegjeeivdfh hfefgeeftdejieelgedtgeffhfetvdevtdenucffohhmrghinhepphhoshhtghhrvghsqh hlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 13 Feb 2023 00:00:41 -0500 (EST) Date: Mon, 13 Feb 2023 14:00:36 +0900 From: Michael Paquier To: Postgres hackers Subject: Force testing of query jumbling code in TAP tests Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4+xIiclTGy//J/Nc" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --4+xIiclTGy//J/Nc Content-Type: multipart/mixed; boundary="GKRRXC0VA3EoySCh" Content-Disposition: inline --GKRRXC0VA3EoySCh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, As mentioned two times on this thread, there is not much coverage for the query jumbling code, even if it is in core: https://www.postgresql.org/message-id/Y5BHOUhX3zTH/ig6@paquier.xyz Ths issue is that we have the options to enable it, but only pg_stat_statements is able to enable and stress it. This causes coverage to be missed for all query patterns that are not covered directly by pg_stat_statements, like XML expressions, various DML patterns, etc. More aggressive testing would also ensure that no nodes are marked as no_query_jumble while they should be included in a computation. Attached is a patch to improve that. The main regression database is able to cover everything, basically, so I'd like to propose the addition of some extra configuration in 027_stream_regress.pl to enable pg_stat_statements. This could be added in the pg_upgrade tests, but that felt a bit less adapted here. Or can people think about cases where checking pg_stat_statements makes more sense after an upgrade or on a standby? One thing that makes sense for a standby is to check that the contents of pg_stat_statements are empty? With this addition, the query jumbling gets covered at 95%~, while https://coverage.postgresql.org/src/backend/nodes/index.html reports currently 35%. Thoughts or comments? -- Michael --GKRRXC0VA3EoySCh Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="query_jumble_test.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/test/recovery/Makefile b/src/test/recovery/Makefile index 570bf42b58..c60314d195 100644 --- a/src/test/recovery/Makefile +++ b/src/test/recovery/Makefile @@ -9,7 +9,7 @@ # #------------------------------------------------------------------------- =20 -EXTRA_INSTALL=3Dcontrib/test_decoding contrib/pg_prewarm +EXTRA_INSTALL=3Dcontrib/pg_prewarm contrib/pg_stat_statements contrib/test= _decoding =20 subdir =3D src/test/recovery top_builddir =3D ../../.. diff --git a/src/test/recovery/t/027_stream_regress.pl b/src/test/recovery/= t/027_stream_regress.pl index 69d6ddf281..9fb565f33c 100644 --- a/src/test/recovery/t/027_stream_regress.pl +++ b/src/test/recovery/t/027_stream_regress.pl @@ -14,6 +14,16 @@ $node_primary->init(allows_streaming =3D> 1); $node_primary->adjust_conf('postgresql.conf', 'max_connections', '25'); $node_primary->append_conf('postgresql.conf', 'max_prepared_transactions =3D 10'); + +# Enable pg_stat_statements to force tests with do query jumbling. +# pg_stat_statements.max should be large enough to hold all the entries +# of the regression database. +$node_primary->append_conf('postgresql.conf', + qq{shared_preload_libraries =3D 'pg_stat_statements' +pg_stat_statements.max =3D 50000 +compute_query_id =3D 'regress' +}); + # We'll stick with Cluster->new's small default shared_buffers, but since = that # makes synchronized seqscans more probable, it risks changing the results= of # some test queries. Disable synchronized seqscans to prevent that. --GKRRXC0VA3EoySCh-- --4+xIiclTGy//J/Nc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmPpw/QACgkQnvQgOdby QH1V2xAAgwgPk9ppkMVSxwbisvhpMcnLnEAi8pYiWJBxauRKVMIgqzkmQdjBot79 8mGXQd7gGSAf0a+0DKTn0UhiyDpXvj5k8YgdVGkSeFDRHr0fLdIk8Px5HEGy7SOg SnHIHnjuJON/K9MzU9R1WF5SeHEDwX/WVu6o/7lqr1lFgFSAW3WkzoChCsoSfTAW rRixMOvMgT00dCT4jLnGw50D/StA1sGLAuCy/J17IapKnRdkePOAiWh0RIdjY/mL 1/r/ST0ZELMm4+nW1EDwUQrdTGT5sYDeLd2nNDBFM67u4ZOYl3jwyIuB4bAUrn2D gT6vM9E3eXhSzAVin4szgngDzacl+9clzJpioibQmwo2W1smME9ot0jjshJ+SLdR rT9orxi6HrM6WWulxidmeZMb6vRmvKQDNe9USRco2Axzb+VtdxKL9AKAZaUi16GG Kwxm+YT0pjPNAbAVb/PyElnunzLhOeW/tf6QDVjcBgCYSmKYLz5E0yI/lOjcVN8s Xr8mH3ego8XJiejCuvnlGyIVL63c9tssZVZkrTwegzJIgirlqDEw29sH7pxoxgji O9K79Sc3FXYA0F/L/aQtyenof5fjI9xElbVVbfKBMDmLU2odhZdi1s+pGtUTVDXR 1aUFAnfWRYtCbjjL8t/Y2iatrtgvcnH61Pnsu6cx6j5crl9Vl84= =UNy9 -----END PGP SIGNATURE----- --4+xIiclTGy//J/Nc--