aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/injection_point.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-07-26 14:55:04 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-07-26 15:11:50 +0300
commitb9e5249c29354186576d8fc00609fe7eaf7c8d25 (patch)
tree7827efe3eb46d439df6c7d549c18b8ca6d17678d /src/backend/utils/misc/injection_point.c
parentc95d2159c1dd3f269383a9bd830e1c804dba34c8 (diff)
downloadpostgresql-b9e5249c29354186576d8fc00609fe7eaf7c8d25.tar.gz
postgresql-b9e5249c29354186576d8fc00609fe7eaf7c8d25.zip
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
Diffstat (limited to 'src/backend/utils/misc/injection_point.c')
-rw-r--r--src/backend/utils/misc/injection_point.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/misc/injection_point.c b/src/backend/utils/misc/injection_point.c
index 8ad0c27bc8a..8ab5bc63276 100644
--- a/src/backend/utils/misc/injection_point.c
+++ b/src/backend/utils/misc/injection_point.c
@@ -85,7 +85,7 @@ typedef struct InjectionPointsCtl
InjectionPointEntry entries[MAX_INJECTION_POINTS];
} InjectionPointsCtl;
-static InjectionPointsCtl *ActiveInjectionPoints;
+NON_EXEC_STATIC InjectionPointsCtl *ActiveInjectionPoints;
/*
* Backend local cache of injection callbacks already loaded, stored in