public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Robert Haas <[email protected]>
Cc: Heikki Linnakangas <[email protected]>
Cc: Postgres hackers <[email protected]>
Cc: Andrey Borodin <[email protected]>
Subject: Re: injection_points: Switch wait/wakeup to use atomics rather than latches
Date: Sat, 30 May 2026 13:13:47 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+TgmoagPYFVPJXibNthGQEPTrpvxM5hW-aph9ejaMOU=GGRLw@mail.gmail.com>
References: <[email protected]>
	<CA+TgmoamSXmT7uMXBw6c3YJgSSz6dYdpMsJf47jwaPH9kVbmyA@mail.gmail.com>
	<[email protected]>
	<CA+TgmoYE-9WhM-owWtX3grbSeHtOJCF__wEEdoD-jj-oJ+=TSg@mail.gmail.com>
	<[email protected]>
	<CA+TgmoagPYFVPJXibNthGQEPTrpvxM5hW-aph9ejaMOU=GGRLw@mail.gmail.com>

On Fri, May 29, 2026 at 12:00:46PM -0400, Robert Haas wrote:
> On Fri, May 29, 2026 at 9:31 AM Heikki Linnakangas <[email protected]> wrote:
>> They only work after you have a PGPROC slot. If you want to inject code
>> to authentication, or into postmaster, you cannot use them.
> 
> OK, got it now.

It seems like Heikki's comment was better worded than mine.

Also mentioned upthread, but the lack of PGPROC also means a lack of
monitoring as wait events cannot be tracked.  Currently, we rely on
that in the TAP tests.  For cases where the procs are not available, I
don't have a better idea than generating a LOG entry after the wait
counts have been generated (with a PID) and couple that with a poll of
the server logs to let a script understand that a process is in
waiting mode.

As a whole, I don't think that we should try to be fancy with the
implementation, which is why I have used primitives that should work
in any context, and I'm not convinced that this is worth its own
facility if that just means more responsiveness (in most cases the
wait should not take more than a couple ms to notice a wakeup).  I'm
open to more fancy ideas, of course.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (21+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: injection_points: Switch wait/wakeup to use atomics rather than latches
  In-Reply-To: <[email protected]>

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

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