pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Michael Paquier <michael@paquier.xyz>
To: Andrey M. Borodin <x4mmm@yandex-team.ru>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Injection points: preloading and runtime arguments
Date: Tue, 9 Jul 2024 12:08:26 +0300
Message-ID: <58d588d0-e63f-432f-9181-bed29313dece@iki.fi> (raw)
In-Reply-To: <Zoe54pHExN-USTpy@paquier.xyz>
References: <ZkrBE1e2q2wGvsoN@paquier.xyz>
	<BF05D322-C71D-432C-8029-8315BEABA5A1@yandex-team.ru>
	<Zkv5XJci7e2jbyvk@paquier.xyz>
	<B0FAFD52-FB9F-452B-A370-25C69A397FA7@yandex-team.ru>
	<Zl-asNW0NUYd_MuF@paquier.xyz>
	<F5CA5FD7-4731-4663-8A05-8B641CF11CA6@yandex-team.ru>
	<ZmJIhkc73nvFNEUS@paquier.xyz>
	<9ED3A789-0516-4781-87C1-5BF966D681EE@yandex-team.ru>
	<ZmaY2W_ZWHlma2Ln@paquier.xyz>
	<Zoe54pHExN-USTpy@paquier.xyz>

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)






view thread (21+ messages)  latest in thread

Message-ID: <58d588d0-e63f-432f-9181-bed29313dece@iki.fi>
Permalink:  ../58d588d0-e63f-432f-9181-bed29313dece@iki.fi/
Also on:    postgresql.org/message-id/58d588d0-e63f-432f-9181-bed29313dece@iki.fi

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: hlinnaka@iki.fi, michael@paquier.xyz, x4mmm@yandex-team.ru, alvherre@alvh.no-ip.org, pgsql-hackers@lists.postgresql.org
  Subject: Re: Injection points: preloading and runtime arguments
  In-Reply-To: <58d588d0-e63f-432f-9181-bed29313dece@iki.fi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox