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.96) (envelope-from ) id 1whLn9-000Aat-2e for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 06:29:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whLn8-0055HY-0m for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 06:29:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whLn7-0055HQ-1R for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 06:29:54 +0000 Received: from fhigh-b4-smtp.messagingengine.com ([202.12.124.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whLn5-000000006o6-49B5 for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 06:29:53 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 348BC7A00DF; Wed, 8 Jul 2026 02:29:51 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 08 Jul 2026 02:29:51 -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=fm2; t=1783492191; x=1783578591; bh=2qbm52xnb1 Swc2A0v/C0FQHA+vW2xuW7Vi3XBY52q1E=; b=HcjY0/mFGcaXT041G7StjhQFYT E3DSc8cJZDfa6dkGrk3b9a0eG2M5VSz/I2piccL0NkdmtD8APQvDUos8IK5d3nvE p2u5ILn7Pg6WXXnB5MgqAEy+vPwN1yDa4SzFchCC2n32IcriKrszzWTtkC0mRcEP 8EJ3NzYp1IPGS+b4AnURw+6gRS+UnBP1F3Yl0NkphhqGcPwloHCvWrZ7DIbJCQm2 +zwJoX+oj9mEscDht7dKh4/6GHBhqJUN3w23ivuuNlaUX5HviAns1jLEUo0wxZsX kVJeyBmS4yewe/MQEaiJtu+zTlUUWR3ix29bkAQ+dH/767w2meSXU+oKDVaA== 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-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1783492191; x=1783578591; bh=2qbm52xnb1Swc2A0v/C0FQHA+vW2xuW7Vi3 XBY52q1E=; b=gYSAh2j8xryt8xSoGjNdtAiSSdI1fhf68DgPi7a7uGt/L4//rZm +r1ZfzWoHEPLxg0uuQTf97cKKvSpv0u12IfB9EfV7JDs6SaE48ANDCxQtF+PYAK+ lHTGm2M1AhVQw/trmyPrJhpEE4yU49OFkeMbuCUA271HAB6zT9vY9HSG8115CyN9 11Z73aRTkI1VK7lKSRchiQxbPwzQtbLsCpr1UThpeEz8V5zow/T7zcR1t8oMrYSS cj+ErhszYHMzSU5NPSQPCtML3kl8izlio15awMoHAqHDMmUENPdwloKV/j/xpYAv dDCAC1iqdXi7pbd1PLtUH39shO9fDNOI2RA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFPUJbJed/kxscTaKSPM82fVg8yYcxlKUra2NloJweXq5sNe2YyneHKtIO+dEHWS4 1sYYLe75N2Lw93Ryw5eQQVEWhXhZ4DetawHr3NwpBk4qSfdY7/xT0vLznuKQGxciRllgGB XcK6xnoRxMyMEfaxWE77zc6eO+2tTjYAqVgkDYuH+55XjCNcnxQTGuZc2Yv4QDjw+uCFLF pPDavj7ShxeeuFkAJQT6o/CDK7CCsF96c16Bw/+fUFhHMuUCrKvfcTRAh9fzERs/m21X1y l6Vxv3EldK2bEL4wVL25iyej+2eU8HnEKKNX/hRgF5P0BRTuhkVY01mAK5d358ROZUf0qQ EFUiFhWUDfUBevtdO7CsEL87XKgyiC9eo3oP5ptBnstrf64Gt/Mx3IuOkxAL2zIq1/df+j X88samz4JuVI7PaMrFicMnsp5aVZnIN5klJtJrnxuF33l+ejELpC7cL3n/xmI4AhuoKLGX SKVn+0k/HtORE+3fOfvGp3Exo3LhKSc845jGrOO2NchArK95Mu84hLtxIugtGnUtGQ6+ZM PDGIM+ZqJSI9PqXSRB+4ndZQoybAs5LuwsykvRb0111WZ7TAuu/xJZ3qovyLVpoVwgGU8R rZ6Vhr3xmu9/7BlXPqDgC0XRUvE2AYXWaPNKS6yo5e/TKhTdHT+UDOuln8Pw X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Jul 2026 02:29:48 -0400 (EDT) Date: Wed, 8 Jul 2026 15:29:44 +0900 From: Michael Paquier To: Andrey Borodin Cc: Robert Haas , Postgres hackers , Heikki Linnakangas Subject: Re: injection_points: Switch wait/wakeup to use atomics rather than latches Message-ID: References: <46821C66-E6B2-420D-BB83-E20EF36665B8@yandex-team.ru> <688F6266-3901-4C84-B27A-AF5904801A3A@yandex-team.ru> <0C7D1930-F8BD-45D3-980B-841F1DBE1204@yandex-team.ru> <45DAF9CC-FAFB-4AC3-9E31-6EB77644E671@yandex-team.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8U0RVBhK57O0Z9bU" Content-Disposition: inline In-Reply-To: <45DAF9CC-FAFB-4AC3-9E31-6EB77644E671@yandex-team.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --8U0RVBhK57O0Z9bU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 07, 2026 at 02:51:04PM +0500, Andrey Borodin wrote: > So the question is whether to rewrite that reproducer on top of these > two patches. This design goes far beyond the minimal > plan you sketched (latch-free wait, attach() with an optional PID, then > the test), and that you were not sure the ProcKill case alone justifies > the churn. Before writing it I would confirm it really needs the > filesystem parts and is not better served by something simpler. >=20 > Alternatively, we can use new capability for some other tests. >=20 > WDYT? The hard part is that the implementation choices are driven by the needs, where we may want to be able to do the following things without having to touch SQL: - Register a wait() at very early stages. - Know from a client perspective that a PID is waiting, as we may not have access to pg_stat_activity. - Trigger a wakeup. Your patch is able to achieve all of that, but it may be better to know better about more use cases folks have seen before taking any hard decision. Here, one good case that I could see in the tree is 007_pre_auth.pl, that uses currently as a workaround a background connection to create a wait point. We could switch that to register a wait early, but the impact is limited. @Heikki, what kind of ideas did you have for some of your toy tests recently, particularly with the protocol area? The protocol tests now in the tree use errors (backend-initialize, GSSAPI and SSL startup points), not waits and/or wakeups. Applied the patch that removes the condition variable dependency, btw. that's one thing less to worry about. -- Michael --8U0RVBhK57O0Z9bU Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmpN7lgACgkQnvQgOdby QH3r6g/8DoOuRseDNY4ndeMt2uZsARhFOZN9M999UjHh/v9bBdXGFPqr/HaP4P2k +cF89KVHa1Q1ioNpGNgaihrfvYxiMzyEzIudPRGPQS3rC8LYT9kbbg/ZHcESo5Pc cqyCnuH/iB7eyeuvEg9Jv32AmhEtucRPp1Sch8srRA4h1nlH/2zRqGLfnoMYa0Ad jFXGbpOvqsqeR4yY/LK35AeZ0ytbpimFn3TzEE7mCwD4k9xyVmeFC4Abjn1KcOhM JxgKBX14U2vVcMIF3vhaD6O/Dh4dONQi5Qe8IsTHuSNyTefoRAQ5IkrC7LxArZt5 mGJ1+3qxiGz4W5tDN8Cw/ZE0XvQw+LJYkd0rC4qgA+XljW+lGnLx2ebTX9450ELk bI4dtQh3N/Qg2gL+3AgVl9rt3WQkeJoBymwhQHojSaFLCW4LRMnoUTUFjK7Asn/b pU2aZTlIztM5+avXzHBzOItDYtTiB4IqAcQexSrtN9DqZ47hqejVrnT3rnlb8UDf mfyv1YEBKXzovItWE5Cx5zUPSgIoz8ixPx26ep4kNW7LxRC64EMOGXBbizZiodE7 a8CCXRCrxh5MjdECoddNatZiOL4p6fGKi06SrfsigTdHkbu8j4FrqqyoQiKGJcaK 4B/TNG5puGawrjhvpoAPlTYZw9ekVUnj9SeuWaKE4urJpZFOte8= =DS7N -----END PGP SIGNATURE----- --8U0RVBhK57O0Z9bU--