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 1sR6pz-00DMc7-24 for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jul 2024 09:08:39 +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 1sR6px-00EKsP-IV for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jul 2024 09:08:37 +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.94.2) (envelope-from ) id 1sR6px-00EKsG-47 for pgsql-hackers@lists.postgresql.org; Tue, 09 Jul 2024 09:08:37 +0000 Received: from lahtoruutu.iki.fi ([2a0b:5c81:1c1::37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sR6pt-001B4X-Pg for pgsql-hackers@lists.postgresql.org; Tue, 09 Jul 2024 09:08:35 +0000 Received: from [192.168.1.113] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4WJFXD4DsQz49Pv5; Tue, 9 Jul 2024 12:08:26 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1720516109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mW0B7vwtvKV2p2ky5n4uw+ozUcJmbLlOgd4cYHan6P8=; b=DkZDVaQ4Dm+09CWaQoZqH1I3LSxbeCI0q3p09f64HaTHCWGKopHtJ+E3Zxu65mT8dWDc+I yuFhLFEPbAFADxTFJOhrUEpoapVRFiuo8SIQRjE56oFj8MLi6IwCOG9B3521scofYt/7FW BtCzaYRcrASRwQcENNJTgoHndbxfh2Eg2qOgoGaHO/yF/yPPEQKVmv4bKavY7rLZPfRdql HjS+lxLv+tLRbjSODu3iWXd80olbYhyELdeFPJZSxCvQC6WvuIsUkEjIhEwICqYpX9BAXq Pc1rfUPymnbLYKpVXg9NXmNiNi8I7yrrfCMTsemL4dxnXAMyfaHRWKx0STfCPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1720516109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mW0B7vwtvKV2p2ky5n4uw+ozUcJmbLlOgd4cYHan6P8=; b=c/lYLh757bmJTB5ZciATfMvwSXbehnyKGCEyJmrpvt6PvsiLHGdqx4l/cODlIUmuxGfe6J h0t3Fc4vKYIP4A7UlR9w3AyLbMBIBuTMwkLPi9UJRd+1TnvQRDJ3T8G1k1kKkQnWTJ7z4b kEwr3qKPKNMHvzAA7Jc2CXHq8X4fp3jcdgqs7CbNVdqlOIBJezJTa5B2ZGHmItOmMYd94y WQ+zcgYev/zMA7RP8gPgibmausJgGMRoibRfFwbMoCoKRuA0GqXzQUJu7W2EHjZbXhhiPE EZYcrnUc2fHlMgEjRWy80pToabhZCDjsFFAbbIg68hcFAjJiVHcpsKcFIHX2Hw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1720516109; a=rsa-sha256; cv=none; b=d5ppZ+eX5I60fzTClymhOkS3mQRVeAlupmQS7LBWzER44sStGzgQjT3bcxWsRoTDwnMj67 tjPCCpcr0A2fRioBLpUaSRrvu7mJVzlX0aiFWyNZ8d1pw/E9uJNkqaS2W53hMlRdrSiRqX NQ98jtWZeT/hTfpBKDd2Fscem+n3Pk1wU5mqpv9tPFy7QAXObUP8Zj+XKT52BMAYgEUS3D lzyJsk+1PBllbP5NzIVqeOmrU1B6FVMh4pbHSX7XhHFP0cVVRU/y54aE+zhCFi0TN2UzOJ wX+EOrYLRbj42O3gdz3yhnmeABFtpxcaTb7wcVw2815wvFdQU3OOSjn85gWLAA== Message-ID: <58d588d0-e63f-432f-9181-bed29313dece@iki.fi> Date: Tue, 9 Jul 2024 12:08:26 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Injection points: preloading and runtime arguments To: Michael Paquier , "Andrey M. Borodin" Cc: Alvaro Herrera , Postgres hackers References: <9ED3A789-0516-4781-87C1-5BF966D681EE@yandex-team.ru> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 05/07/2024 12:16, Michael Paquier wrote: > On Mon, Jun 10, 2024 at 03:10:33PM +0900, Michael Paquier wrote: >> OK, cool. I'll try to get that into the tree once v18 opens up. > > And I've spent more time on this one, and applied it to v18 after some > slight tweaks. If you do: INJECTION_POINT_LOAD(foo); START_CRIT_SECTION(); INJECTION_POINT(foo); END_CRIT_SECTION(); 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. I propose we introduce an INJECTION_POINT_CACHED(name) macro that *only* uses the local cache. We could then also add an assertion in InjectionPointRun() to check that it's not used in a critical section, to enforce correct usage. -- Heikki Linnakangas Neon (https://neon.tech)