aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/arrayfuncs.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-03-04 09:19:13 +0900
committerMichael Paquier <michael@paquier.xyz>2024-03-04 09:19:13 +0900
commit37b369dc67bc44a3aab5c07e2c0012475efd00f3 (patch)
treeb42a6f23b9ddadf63291cf6ec7f61b9d0c605121 /src/backend/utils/adt/arrayfuncs.c
parent024c521117579a6d356050ad3d78fdc95e44eefa (diff)
downloadpostgresql-37b369dc67bc44a3aab5c07e2c0012475efd00f3.tar.gz
postgresql-37b369dc67bc44a3aab5c07e2c0012475efd00f3.zip
injection_points: Add wait and wakeup of processes
This commit adds two features to the in-core module for injection points: - A new callback called "wait" that can be attached to an injection point to make it wait. - A new SQL function to update the shared state and broadcast the update using a condition variable. This function uses an input an injection point name. This offers the possibility to stop a process in flight and wake it up in a controlled manner, which is useful when implementing tests that aim to trigger scenarios for race conditions (some tests are planned for integration). The logic uses a set of counters with a condition variable to monitor and broadcast the changes. Up to 8 waits can be registered in a single run, which should be plenty enough. Waits can be monitored in pg_stat_activity, based on the injection point name which is registered in a custom wait event under the "Extension" category. The shared memory state used by the module is registered using the DSM registry, and is optional, so there is no need to load the module with shared_preload_libraries to be able to use these features. Author: Michael Paquier Reviewed-by: Andrey Borodin, Bertrand Drouvot Discussion: https://postgr.es/m/ZdLuxBk5hGpol91B@paquier.xyz
Diffstat (limited to 'src/backend/utils/adt/arrayfuncs.c')
0 files changed, 0 insertions, 0 deletions