pgsql: Fix using injection points at backend startup in EXEC_BACKEND mo

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix using injection points at backend startup in EXEC_BACKEND mo
Date: 2024-07-26 12:38:54
Message-ID: E1sXKDm-001Iy4-0O@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix using injection points at backend startup in EXEC_BACKEND mode

Commit 86db52a506 changed the locking of injection points to use only
atomic ops and spinlocks, to make it possible to define injection
points in processes that don't have a PGPROC entry (yet). However, it
didn't work in EXEC_BACKEND mode, because the pointer to shared memory
area was not initialized until the process "attaches" to all the
shared memory structs. To fix, pass the pointer to the child process
along with other global variables that need to be set up early.

Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b9e5249c29354186576d8fc00609fe7eaf7c8d25

Modified Files
--------------
src/backend/postmaster/launch_backend.c | 12 ++++++++++++
src/backend/utils/misc/injection_point.c | 2 +-
src/include/utils/injection_point.h | 4 ++++
3 files changed, 17 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2024-07-26 12:58:35 pgsql: pg_createsubscriber: Message style improvements
Previous Message Heikki Linnakangas 2024-07-26 12:38:53 pgsql: Fix fallback behavior when server sends an ERROR early at startu