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 1pypQO-0007BY-Tf for pgsql-hackers@arkaria.postgresql.org; Tue, 16 May 2023 07:48:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pypQN-0006eC-QD for pgsql-hackers@arkaria.postgresql.org; Tue, 16 May 2023 07:48:47 +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 1pypQM-0006e1-GG for pgsql-hackers@lists.postgresql.org; Tue, 16 May 2023 07:48:47 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pypQI-0005G9-Sg for pgsql-hackers@lists.postgresql.org; Tue, 16 May 2023 07:48:45 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B8AEC5C01DC; Tue, 16 May 2023 03:48:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 16 May 2023 03:48:41 -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=fm1; t=1684223321; x=1684309721; bh=GF F6qSaE3q4GREV1+J0Wff3wzZKtoKE1C1N4lA1/s1A=; b=Ksm/YHdNqMer11jUna IuNkHWh7Dd5kx8iJYC+G1Lf4uSOVEun716iupFoYY8MGOrbQAB8ZqxMKsBiYN5VQ 2wWPcIQJW7tvJxrO8+sA8bIL8q5xMFiGSQifo2vOTnxq0xkQBYo2NwWiuXptIzHd 0826eiO+0tNbaf/WdNOTspzNCtn1ZiwP7G6HGZ3ZIHF5r0iCkvqZfJ4UE2wA746J a8XUtjmOgQM4F/tiAFDTdPuEVWuWJ9plQAOmKKneFclnSTgopGq3pIZEWX9um+Zg 0HNQyVFZdA76nCYq0Xui08pQYcAQqvLty5XlLSoaXZTi+/Rgtwqyry9nGYxhg/Bs 2DdA== 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=fm1; t=1684223321; x=1684309721; bh=GFF6qSaE3q4GR EV1+J0Wff3wzZKtoKE1C1N4lA1/s1A=; b=lhzK78MxvTDPHXh/assrcXKItba12 oW+xA8QGcs4HJWmpla266p641ZOcD2T1rFlBv3cT2hYYM5Yt6XMLugWnZLZDhhD2 lzWOYhFGlJDhr98bQqO84uGI8mU35REV0cYyO+8CAA8yELXum3xoiBFMi62dL1/v hIXIH2ZMW10eNcmpnc7TAuyiILNUBqbmH9BvMiVkE81LUcnFlY7xlYSTCWvCItpb Yzsfu/s3gSmmXodMSCciQTCpHtg/ThwbzJ9hlOk3WVWRSzdXZ79UjIUqUCF394du OwaT5QnxQyQvW7eKm+Vd/mXEbXVy+Y1o3dWpfsphWFfmjHBAMdGhLYq/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeehkedguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreer tddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlse hprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpefffffhudelleduhfejledt iefhgfevvdetteevgeelhfdtudehfeeitedtveefgeenucffohhmrghinhepghgvnhgvrh grthgvqdifrghithgvvhgvnhhtthihphgvshdrphhlpdhpohhsthhgrhgvshhqlhdrohhr ghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmih gthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 May 2023 03:48:40 -0400 (EDT) Date: Tue, 16 May 2023 16:48:35 +0900 From: Michael Paquier To: "Drouvot, Bertrand" Cc: PostgreSQL Hackers Subject: Re: Autogenerate some wait events code and documentation Message-ID: References: <64fc361e-f4ed-45eb-0cfb-c8110872530d@gmail.com> <124bdcea-bdc8-e3d2-2357-0c6a857bc557@gmail.com> <106e8d0a-0820-687a-7da5-3143e1f5b05b@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="YG9W6nBIFi3x4MLB" Content-Disposition: inline In-Reply-To: <106e8d0a-0820-687a-7da5-3143e1f5b05b@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --YG9W6nBIFi3x4MLB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 15, 2023 at 06:45:23PM +0200, Drouvot, Bertrand wrote: > On 5/6/23 4:37 AM, Michael Paquier wrote: >> On Sat, May 06, 2023 at 11:23:17AM +0900, Michael Paquier wrote: >>>> I'll look at v7 when the v17 branch opens and propose the separate pat= ch >>>> mentioned above at that time too. >>>=20 >>> Thanks, again. >>=20 >> By the way, while browsing through the patch, I have noticed two >> things: >> - The ordering of the items for Lock and LWLock is incorrect. >=20 > Oh right, fixed in V8 attached (moved the sort on the third column > instead of the second which has always the same content "WAIT_EVENT_DOCON= LY" > for Lock and LWLock). Ah, I didn't notice that. Makes sense. >> - We are missing some of the LWLock entries, like CommitTsBuffer, >> XactBuffer or WALInsert, as of all the entries in >> BuiltinTrancheNames. >=20 > Yeah, my bad. Fixed in V8 attached. BufFileTruncate and BufFileWrite have an incorrect order in HEAD's monitoring.sgml (will fix in a minute for 16~). So your patch fixes that. PgStatsDSA and PgStatsData are reversed in your patch compared to HEAD, actually, based on the way perl sees fit to do its ordering by giving priority to upper-case characters. Same for RelCacheInit and RelationMapping, or even SInvalRead/SInvalWrite being now before the "Serial" family. Worse, the tables LWLock and Lock are in an incorrect order as well with the patch. We'd better be a bit more verbose with the sort step, I think.. perl does not handle well sorting with collations from what I recall, but we could use uc() with a block sort to force the operation to be case-insensitive, like "sort {uc($a) cmp uc($b)}". That needs to be applied here, I guess:=20 +# Sort the lines based on the third column +my @lines_sorted =3D + sort { (split(/\t/, $a))[2] cmp(split(/\t/, $b))[2] } @lines; And it looks like you'd need to apply uc() on each [2] element. I would add a comment about this detail, as well. No entries are missing, after comparing what's generated by the patch with the contents of HEAD. Small nit-ish question: waiteventnames.sgml or wait_event_types.sgml? Same for generate-waiteventtypes.pl? >> My apologies for not noticing that earlier. This exists in v6 as much >> as v7. >=20 > No problem at all and thanks for the call out! FWIW, I would have posted two patches, one with the refactoring of done in [1], and a second that switches to the automation, to make clear the preparatory step. [1]: https://www.postgresql.org/message-id/c6f35117-4b20-4c78-1df5-d3056010= dcf5@gmail.com -- Michael --YG9W6nBIFi3x4MLB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmRjNVMACgkQnvQgOdby QH22ig/+MP9wqll6mqc+yyBrEw8GQIvFzQH5JM4z+Jo0yVNFuHONmHnYxz3ryHBN Kz93gTbbSkhOO/Acl85xkdmumwHB47KM9mqARYz1TcKQwluopsxaWTjwqrMNiWv3 9S9JmlOa0MyOv03uySf/tKDMHC4RAo/eJ7x3pZHSPNqF2P9jzAOb6LJa1LqMBtMk UMo10Frv+hQQsE8wfunydOVusTuqkvF2PhhaWXHi8D4EJf7oOLG1i6jOjtfH/s/L onVqLSG1GLqJXXUY5pOijtCBIWyE8VY8TQ7E4oGaNIMzKryPuQkteP9rw3+s944o lK/mw2VjKDWW1MZs0k9ZUZK7D+BJjwuHRbCBG89wR4h8YZ6gKLOFqWzi/N14yXpZ nJAaF5EMK+cahPcBgxhnwaeewPNAX+5dEby9K4/nCM/QVlVQVmAT5rxb6jydj9Op M2jYmNYtgziwiRaPXnmRJDJJVzJPI2LzqWgMVkPMRaBDUL65URTAx3cUeiipna/o Dz5QgDFCShSN+ioMvA7VfSs/hd6am4tZnCfz0rU7BcueNd618sOYCtAFA3DWHvnK oOeHO/KVDjwipH0YcOPC4H5TZtiuvFLS17JpyTyeHtv+fSymcy9kQR68Tu+Teav6 rLfPBfyxXBpk78ui1AP2PR+u8KLBGumh2/NUlUBJ8yJm4qJFz7I= =a+BG -----END PGP SIGNATURE----- --YG9W6nBIFi3x4MLB--