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 1wAy1T-000c0D-2L for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 22:38:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAy1R-007zNW-0Y for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 22:38:50 +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 1wAy1Q-007zNO-0e for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2026 22:38:49 +0000 Received: from fout-a1-smtp.messagingengine.com ([103.168.172.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wAy1O-00000000Ead-2lrO for pgsql-hackers@postgresql.org; Thu, 09 Apr 2026 22:38:48 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 6D10CEC01A8; Thu, 9 Apr 2026 18:38:45 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 09 Apr 2026 18:38:45 -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=1775774325; x=1775860725; bh=i/RoW61nc7 6Jwg25O/N020moqh4nfG7muC64rvWQJ0I=; b=D/mFstNRXOnb6ewv+vt6YvZwnt D5tRyICUSO0cOW6mcQpLYmdGDCjB2Ezv+cZgaCF0NzkDy8tQTAu2UUuvOzKwdwuq 13p6aU2soA+t31asmld5zFOXgni0tCwJh7zsnpZFcuJivKrRgT6aAFP6RsEXh9If C2HhRwTMNkvpUgLo2cibPoypOHDhumeIBv0WEZZMjdUCBMC9tNlPwmz8hRNoxn1m GOPmKB678juNuENjPdDV71lsdQoOVnN2JTNly7KrrD/7x7neGnlKGpjK1qZOheFM aDVF+4R1RKx7UGSw9p9RfegiGSeMWtFhl1iRkYD/gdfLdsDVk9lPn3xbmOgg== 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= 1775774325; x=1775860725; bh=i/RoW61nc76Jwg25O/N020moqh4nfG7muC6 4rvWQJ0I=; b=Jzc/laKX7DCGIAq2p3Qb79FgaqfIp/er+R/pjU79aDMt43rp3ib s9aWWZR1Tw7tjz4LcWRulY8i4s7U1LAMCUhxQvO13ZmybA5tdO1Xs1815FO4syxR qAF5+vxtMJSLPXNoJTSt4Opj2ISf6useMRCesvvwBSitYRSo5EsBWkddAEZkDD5+ lbAemaGUJ2vR0iprq7x5XPh07UdEzm0szfg6vJu/h/qN8WVDhX7+KrFsBUCGGPsG zJlAVxpTkYLXz1bQ2d+tMAb3oiCntjN/L0ACEc2PygxN5zwLs19Chf0a9lq3W/pE L5RYopEFOg6yrGaYmJfpx1I/c/SL3UEMoUg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvjeejvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehsrghmih hmshgvihhhsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghr shesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepshgrfigruggrrdhmshhhkh esghhmrghilhdrtghomhdprhgtphhtthhopeefuggrnhhishhsihhmohesghhmrghilhdr tghomh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Apr 2026 18:38:43 -0400 (EDT) Date: Fri, 10 Apr 2026 07:38:38 +0900 From: Michael Paquier To: Sami Imseih Cc: pgsql-hackers , Masahiko Sawada , Daniil Davydov <3danissimo@gmail.com> Subject: Re: Allow a condition string in an injection point Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rk5YzPsEWX5GRsCG" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --rk5YzPsEWX5GRsCG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 09, 2026 at 01:02:37PM -0500, Sami Imseih wrote: > A follow-up to the discussion here [0], here is a patch that allows > for an arbitrary string in injection points to be able to apply more > granular filters for running an injection point. This will be useful > for autovacuum testing as discussed in the referenced thread, > and perhaps in some other places. Are the patches under discussion required for v19 or is that something that can wait before v20 opens for business? We have always required a use-case in core before adding a new API in this module, to justify its existence. > The string is capped at 256 bytes which seems like a reasonable > value. I considered using a flexible_array_member and to track > the length, but that hardly seemed worth it at this stage. This change is local to the module injection_points. That can be changed at will even in the back-branches. > A case I envision, and there could be more is only run > the injection point for a specific rel. >=20 > SELECT injection_points_attach('my-inj-pt', 'wait', 'tab1'); We may be able to simplify a couple more places that rely on multiple INJECTION_POINT currently, with slightly different names. I doubt these currently in the tree are worth changing. That would make backpatches more invasive for the tests, which is more noise, so most likely no. > #ifdef USE_INJECTION_POINTS > INJECTION_POINT("my-inj-pt", RelationGetRelationName(rel)); > #endif Ahah, nice. You'd probably want to schema-qualify or database-quality that anyway. > Worth noting, the condition types were changed to bit flags since > we may need to combine conditions such as local injection point > and string. It's definitely more useful to allow combinations of them in an AND fashion (if two conditions are defined then check both, and allow the point to run if both conditions pass). Just to say that what you are doing looks sensible for me. And I find that pretty cool for its simplicity and what it could provide for future tests. @@ -322,6 +322,7 @@ InjectionPointAttach(const char *name, strlcpy(entry->name, name, sizeof(entry->name)); strlcpy(entry->library, library, sizeof(entry->library)); strlcpy(entry->function, function, sizeof(entry->function)); + memset(entry->private_data, 0, INJ_PRIVATE_MAXLEN); if (private_data !=3D NULL) memcpy(entry->private_data, private_data, private_data_size); Hmm, this could be qualified as a bug, and surely it's a good practice to clean things on attach. I'll go backpatch that. -- Michael --rk5YzPsEWX5GRsCG Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnYKm4ACgkQnvQgOdby QH3J0w/9ERk2+TeLdNVMQjXlM0WAfMdCCF03Pi5GIqYDOd87xDE78Q/hAMoTAMge IfkVthfaEueBixfKBG7qKIyWmYxYHfoMawMDrmzbS+YDgsi9PL7qR/NdP86vBrNO dhr2li2V8mlsPTJDyOio42DvYb/C3uUQptKoXRDeIZKE2bciH57lOWe6QKyMLa+V wkty9CAiI/xHGFw8Wn9RGiXOa4U3lSTVECqHNjutXS09T+K6hGMDgddg+xUojteK 8Tqp0U226O7Aw4+P8XVLCawOV55KzBNioePNrQm1qxcjZeNvxPGB0xMEcXte/4Q0 KNPWcAi+2IrHdGGZvbf+5pAUF8tb1bXlzUASoYKVsYJgh9qktQGF5davfDW8HEYt axpW7/MzPFbxnmANGISLGSyTPSWTdlJUDXtcbFyVlmQdcrp1FPaPy50pq33yGqRT d0QC2jzmTQmZoRghc4egpST93m+a/G1wGWcazzF/lQvG7Nz2jsaXKoZ3o/THuxZV 2aqbGxM84ldaNyW7Rnc7wOGFXGkEAEOWAh5IMQZJJGpJEV/e5jDjdpqD0zSY5Lda Qtjf9RbAXQWBsEbXQuDoyWh1eM9cqQ/u5yEBmuczfe9hIbKKqpKZIxme6p3F6sKx CLbdDSSe5m1mRdLnwB/CbiZg6hX841dYydsynTZmPfq1FlPZxNM= =TaAa -----END PGP SIGNATURE----- --rk5YzPsEWX5GRsCG--