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 1sROkw-00Evas-LZ for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jul 2024 04:16:38 +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 1sROku-001rjY-7q for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jul 2024 04:16:36 +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 1sROkt-001rjQ-Tj for pgsql-hackers@lists.postgresql.org; Wed, 10 Jul 2024 04:16:35 +0000 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sROkq-001KTH-ND for pgsql-hackers@lists.postgresql.org; Wed, 10 Jul 2024 04:16:34 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id EF9CA114123D; Wed, 10 Jul 2024 00:16:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 10 Jul 2024 00:16:30 -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=1720584990; x=1720671390; bh=7+ci/zRtjh 7XX459Csalo+Z47oiKaJF9MET6ZfGgN0A=; b=WxHMMADxRt+rSA1HBfydCBh4zZ pbOhZKox1Wxfp6fI33ennhfuQymkXToW8uXZ4bzqrVoy9sn8atwrssR1RJ6aIYZd B5ShmukPFc3kWV+ghIuw0MURMZFRdqZMGf0wlKcuInyrLDE/zvVW7Twqzd0Mu4F4 j8bK4SGvk3KePpMvR0SQraEkBf7DBHvkOLsGLs47cdSGizAEUBwaMC8707zIGYEh r98xwcYknnqU13ag2oP/cfL0HlV84uh0NMouH8AhW/YqpTMvkS4NVZMdOCCZCSkG 50NEiyOeiKl050VqBAU4PWVVa6C2+fg5WnDh+scHy0k1tJlI8NoYkRAxh+Yw== 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= fm2; t=1720584990; x=1720671390; bh=7+ci/zRtjh7XX459Csalo+Z47oiK aJF9MET6ZfGgN0A=; b=b97W2xudUziV7iZhcbiVUY7iXmvLPA9/XBB3bc1mFIsH R0RKBs3iPZDxXIy5gjbGWlvis4CeLCvIqQywvHGFk74gHHR+1aH4cwe7K7onypVW k418FhDmsXtxJz2DsfZQbII6dVhFTDleaJxOY86Z914dYqnTn8yUa6oh084T8bQZ cuRq9qICzhQfdb/t6q+o1lUmPY3oofzn796OA1sRaYYJy8AKvI3qhtug/4VF4N2A UunFrn7UbsHB1pP7rhkG4FdtGA7kfEd3tpBkumxss3ag3BABc161XX+voKOFgTK4 7NRd27ByL6SnZ6EVJfWsW6BYYS16ZbVnZrvDvIy6qw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrfedtgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeegffejvefgveduvdejtddvtdei jeehudeuledvudeftdfgfeejvdekveekiedvvdenucffohhmrghinhepphhoshhtghhrvg hsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Jul 2024 00:16:27 -0400 (EDT) Date: Wed, 10 Jul 2024 13:16:15 +0900 From: Michael Paquier To: Heikki Linnakangas Cc: "Andrey M. Borodin" , Alvaro Herrera , Postgres hackers Subject: Re: Injection points: preloading and runtime arguments Message-ID: References: <9ED3A789-0516-4781-87C1-5BF966D681EE@yandex-team.ru> <58d588d0-e63f-432f-9181-bed29313dece@iki.fi> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oMz9423kX72+0Fqn" Content-Disposition: inline In-Reply-To: <58d588d0-e63f-432f-9181-bed29313dece@iki.fi> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --oMz9423kX72+0Fqn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 09, 2024 at 12:08:26PM +0300, Heikki Linnakangas wrote: > And the injection point is attached in between the INJECTION_POINT_LOAD() > and INJECTION_POINT() calls, you will still get an assertion failure. For= a > testing facility, maybe that's acceptable, but it could be fixed pretty > easily. >=20 > I propose we introduce an INJECTION_POINT_CACHED(name) macro that *only* > uses the local cache. You mean with something that does a injection_point_cache_get() followed by a callback run if anything is found in the local cache? Why not. Based on what you have posted at [1], it looks like this had better check the contents of the cache's generation with what's in shmem, as well as destroying InjectionPointCache if there is nothing else, so there's a possible dependency here depending on how much maintenance this should do with the cache to keep it consistent. > We could then also add an assertion in > InjectionPointRun() to check that it's not used in a critical section, to > enforce correct usage. That would be the same as what we do currently with a palloc() coming =66rom load_external_function() or hash_create(), whichever comes first. Okay, the stack reported is deeper in this case. [1]: https://www.postgresql.org/message-id/87c748b3-0786-490f-a17a-51bef63e= 6c7f@iki.fi -- Michael --oMz9423kX72+0Fqn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmaOCw8ACgkQnvQgOdby QH3SJQ/+L/L/vJuH2uIBr/LlO854QH2m6eA1qnSS70PPpMyg/0VUbtywT8F8+Bhj MzVZx2MlSI8vgLaUmwTQ3x2536Jmn04TQjGZylvWdUq6gZJH6e/9czDgnA93nk5e pJI4RjIxDavT1lViAVNkKghVftklICQQDRAOxatG1v9aMxdqZ7j1xDqFQYkToI9u kzM22x7lIRPNBsDIrJXo3bIRDt2MUmTpEE2ccghEkIkDAMwX2DyYfpTYOqoSA9OD qGanmI812pxla6xA0Vqn+ZSKtZhE/lHITu/5yOe0InaPBouDrrK5BHwuJ+FgX4Gb gnHd9KPBtP6QbK+8Jls5C3SVPIhc/mDAJ+TcNIde37pOE4oBBOvEqD2W05oKm6MH BjlAf0EfWmxzFSdCRZC+Q9QNAeGWV2VN1NdFB+BcXeaOxZJzlWpW+0RSQdjq6Nlg 6LWPgX3dDhYFVgJauwyoaNRGqVJO/7iK4qx1dnYDw33xuK8oi3+pPQ+zDupa8jfg H4U1inWgLyXYe6MHO93yIS1Kb7MyeeSkFbIWYhZO7eJj+WHBmjSV/SzQK8Ar+h4M seBP/HUw6zga7ID1fj/mlE0GAhEhC9TVVdTWdn6jqCogcT8Y3puj4oSO0xxpIrv6 dgxcQn69UO+sVLvsgasw4/22AyJYd3DHo5LtSwIqI68fAtLTsRY= =Rkl0 -----END PGP SIGNATURE----- --oMz9423kX72+0Fqn--