aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/postmaster/launch_backend.c12
-rw-r--r--src/backend/utils/misc/injection_point.c2
-rw-r--r--src/include/utils/injection_point.h4
3 files changed, 17 insertions, 1 deletions
diff --git a/src/backend/postmaster/launch_backend.c b/src/backend/postmaster/launch_backend.c
index e9fc9827878..fafe5feecc2 100644
--- a/src/backend/postmaster/launch_backend.c
+++ b/src/backend/postmaster/launch_backend.c
@@ -63,6 +63,7 @@
#include "utils/builtins.h"
#include "utils/datetime.h"
#include "utils/guc.h"
+#include "utils/injection_point.h"
#include "utils/memutils.h"
#include "utils/timestamp.h"
@@ -104,6 +105,9 @@ typedef struct
void *UsedShmemSegAddr;
slock_t *ShmemLock;
struct bkend *ShmemBackendArray;
+#ifdef USE_INJECTION_POINTS
+ struct InjectionPointsCtl *ActiveInjectionPoints;
+#endif
#ifndef HAVE_SPINLOCKS
PGSemaphore *SpinlockSemaArray;
#endif
@@ -710,6 +714,10 @@ save_backend_variables(BackendParameters *param, ClientSocket *client_sock,
param->ShmemLock = ShmemLock;
param->ShmemBackendArray = ShmemBackendArray;
+#ifdef USE_INJECTION_POINTS
+ param->ActiveInjectionPoints = ActiveInjectionPoints;
+#endif
+
#ifndef HAVE_SPINLOCKS
param->SpinlockSemaArray = SpinlockSemaArray;
#endif
@@ -969,6 +977,10 @@ restore_backend_variables(BackendParameters *param)
ShmemLock = param->ShmemLock;
ShmemBackendArray = param->ShmemBackendArray;
+#ifdef USE_INJECTION_POINTS
+ ActiveInjectionPoints = param->ActiveInjectionPoints;
+#endif
+
#ifndef HAVE_SPINLOCKS
SpinlockSemaArray = param->SpinlockSemaArray;
#endif
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
diff --git a/src/include/utils/injection_point.h b/src/include/utils/injection_point.h
index a385e3df649..a5b4a1f0f9f 100644
--- a/src/include/utils/injection_point.h
+++ b/src/include/utils/injection_point.h
@@ -43,4 +43,8 @@ extern void InjectionPointRun(const char *name);
extern void InjectionPointCached(const char *name);
extern bool InjectionPointDetach(const char *name);
+#ifdef EXEC_BACKEND
+extern PGDLLIMPORT struct InjectionPointsCtl *ActiveInjectionPoints;
+#endif
+
#endif /* INJECTION_POINT_H */