Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1soWyy-00Bx9G-RM for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 23:42:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1soWyw-00AQNq-9L for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 23:42:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1soWyv-00AQNi-U8 for pgsql-hackers@lists.postgresql.org; Wed, 11 Sep 2024 23:42:41 +0000 Received: from fout3-smtp.messagingengine.com ([103.168.172.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1soWyn-000iu4-VQ for pgsql-hackers@postgresql.org; Wed, 11 Sep 2024 23:42:41 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 723EB13801BD; Wed, 11 Sep 2024 19:42:33 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 11 Sep 2024 19:42:33 -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:subject :subject:to:to; s=fm1; t=1726098153; x=1726184553; bh=Q/nH4NqDAw dM4RU38Qg9nB/f7cP4QBhc1y8dDmmWelY=; b=jyDuhGLAohj/OXgWD70FaB+uD2 5topTMzBrK9YKo4Lv08trTyMbD9BBMy0BII3ZLQk96CGQpKXWiIQq8SAX14+jyO2 Tf8Ji4lST9fHai4/AIUb/tcMFrL8vgBqccITxlTS2Krm3jGgs8fX+J3lA2vDIKXL bUl2PwzE4XdytycjZBce4EWOQvDF6zb5Vg61E2vB9HG5uE/q4FCVkoYw8XeyQKlU MzbcabTlL5lFTHgA7wWIMPkfDVPt84eNdb44kNgna85LX/5Czvf1eOZOO2Ne8Fg+ hlvayRscbKLbnD/PfFxyznrv2xR4x+7WUY0vT527I8kGqyc2gyYLbnvTLcZQ== 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:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1726098153; x=1726184553; bh=Q/nH4NqDAwdM4RU38Qg9nB/f7cP4 QBhc1y8dDmmWelY=; b=snBRKTgZuJr7CWsGDu6ja4rJ+vXhrYMza2QOdUhpyBlU vGW5PtTIIj5nBmq9rMZjv1Xmh2mr9wpH5ebi/68joS0ehEYXjsizPAHLVfHJQjZc zLnnyyc31tTPWJvtNBGO+Z1exs+sami6i58dG7B6FUjuLbpVkZR7GkrBDnGCKXD+ GYctCYYPm6I8vkZwFAWukvvh4EPWk7NHr4uDOATiebzmfw24ELWm19oQ2mopmLwW qemDQKBb0fIztm6MuEs9a6vZHBQd2ZvWjOonwlGRASXf/PmHX2BYo3QpdphMj0vs zYxJN1du/esXd/OkR/pHw3jHHliBL5fbCll/hHU3VQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudejvddgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhf gggtuggjsehgtderredttdejnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruc eomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepveet jefgjeevgedukeehieeuieeuieevueeiudegheevuefggfduueelgeelieetnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtohepjhgrtghosgdrtghhrghmphhiohhnsegvnhhtvghrphhrihhsvggu sgdrtghomhdprhgtphhtthhopegrnhgurhgvfiesughunhhslhgrnhgvrdhnvghtpdhrtg hpthhtohepnhhorghhsehlvggruggsohgrthdrtghomhdprhgtphhtthhopehpghhsqhhl qdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopegvuhhlvg hrrdhtrghvvghirhgrsegvnhhtvghrphhrihhsvggusgdrtghomhdprhgtphhtthhopehr ohgsvghrthhmhhgrrghssehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Sep 2024 19:42:30 -0400 (EDT) Date: Thu, 12 Sep 2024 08:42:25 +0900 From: Michael Paquier To: Jacob Champion Cc: Andrew Dunstan , Noah Misch , PostgreSQL Hackers , Euler Taveira , Robert Haas Subject: Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible Message-ID: References: <20240630174812.d1.nmisch@google.com> <34cc0828-d988-4503-9944-ea6288f0ca8a@dunslane.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VuvlzXfpkkr5T7C8" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --VuvlzXfpkkr5T7C8 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 11, 2024 at 02:29:49PM -0700, Jacob Champion wrote: > On Mon, Sep 9, 2024 at 10:30=E2=80=AFPM Michael Paquier wrote: >> No. My question was about splitting pgstat_bestart() and >> pgstat_bestart_pre_auth() in a cleaner way, because authenticated >> connections finish by calling both, meaning that we do twice the same >> setup for backend entries depending on the authentication path taken. >> That seems like a waste. >=20 > I can try to separate them out. I'm a little wary of messing with the > CRITICAL_SECTION guarantees, though. I thought the idea was that you > filled in the entire struct to prevent tearing. (If I've misunderstood > that, please let me know :D) Hm, yeah. We surely should be careful about the consequences of that. Setting up twice the structure as the patch proposes is kind of a weird concept, but it feels to me that we should split that and set the fields in the pre-auth step and ignore the irrelevant ones, then complete the rest in a second step. We are going to do that anyway if we want to be able to have backend entries earlier in the authentication phase. >> Couldn't it be better to have a one-one mapping >> instead, adding twelve entries in wait_event_names.txt? >=20 > (I have no strong opinions on this myself, but while the debate is > ongoing, I'll work on a version of the patch with more detailed wait > events. It's easy to collapse them again if that gets the most votes.) Thanks. Robert is arguing upthread about more granularity, which is also what I understand is the original intention of the wait events. Noah has a different view. Let's see where it goes but I've given my opinion. > I can test for specific contents of the entry, if you'd like. My > primary goal was to test that an entry shows up if that part of the > code hangs. I think a regression would otherwise go completely > unnoticed. Perhaps that would be useful, not sure. Based on my first impressions, I'd tend to say no to these extra test cycles, but I'm okay to be proved wrong, as well. -- Michael --VuvlzXfpkkr5T7C8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmbiKuEACgkQnvQgOdby QH18nQ/8DVSXU3MlphkEzpwZMiZckMbdmWXG8t0xt7aoOypazXOj4GmCyP9R37Gi sbX6AODsGkPhh6vEItzOQDbtRR2L6MW8Mssy6weTOT5204bVR2l+0/U7uj6adzAC ik/37WcydYGN7qBoTJZb8XAoPaYSsSXgEp1N6ZPak9ej7iMEPDs7/kdI+DSfDmxa xce68k/sD9IoNYiY+QX6U6iA4qdtYNaedNL7whZNY1CyBz11JNEGA9tSdV6m5xea IZdSL6R6ah4a/r8GGhv8anh7Lm/FEcamLWnAmiDMkFjbsMHUdQVQzHVTAEZvImMb n7twONZnecVQs927JDY3VTlo/XDSnhPB9PhOk/SyiVIDZvQVE9LrjvR7nBW2nxhA oE724iz4e+0H1NGBNB45aRVx9Aa7ticllrM9BkckEO6htl/jQISqrMBZe+kSAyZL 5D11N+YOFwzh7er0+zI+WoOptWNxnQFrnU7xRL07KJNgs4pM42Fw5wHprfCVVGAa RqSIWhyXgd4m09WJnHeVhFC+tmu9R9wxuHM0MGQpWsiBuAIkTDslFwkOya+H7/0J Iqc+SD9S6muNPJ4lrfDKupRWiA00VZdk1QgSWQ53MyeY/YehZzCNcpAAVvrX1DFa GT0iX0RSdE00BoWS0l3wCk9CUfi5Mm9vl+IouXhJmGkCpEHNawk= =Tvfs -----END PGP SIGNATURE----- --VuvlzXfpkkr5T7C8--