On Fri, May 30, 2025 at 11:02 AM Antonin Houska <ah@cybertec.at> wrote:
Why is it important not to fork?
Good question. Forking is expensive, and there is also a lot of housekeeping associated with it that is simply not needed here. We want this to be lightweight, and simple. No need to fork if we are just going to do a few strncmp() calls and a send(). However, I'm not highly opposed to fork-first, as I understand that we want to not slow down postmaster. My testing showed a barely measurable impact, but I will defer to whatever decision the elder Postgres gods decide on.
My understanding is that pg_is_ready also tries to start a regular connection, i.e. forks a new backend.
Yep. I consider pg_isready a spiritual cousin to this feature, but it's not something that can really do what this does.