postgresql/src
Michael Paquier 267d41dc4f injection_points: Store runtime conditions in private area
This commit fixes a race condition between injection point run and
detach, where a point detached by a backend and concurrently running in
a second backend could cause the second backend to do an incorrect
condition check.  This issue happens because the second backend
retrieves the callback information in a first step in the shmem hash
table for injection points, and the condition in a second step within
the callback.  If the point is detached between these two steps, the
condition would be removed, causing the point to run while it should
not.  Storing the condition in the new private_data area introduced in
33181b48fd ensures that the condition retrieved is consistent with its
callback.

This commit leads to a lot of simplifications in the module
injection_points, as there is no need to handle the runtime conditions
inside it anymore.  Runtime conditions have no more a maximum number.

Per discussion with Noah Misch.

Reviewed-by: Noah Misch
Discussion: https://postgr.es/m/20240509031553.47@rfd.leadboat.com
2024-05-12 19:42:26 +09:00
..
backend Introduce private data area for injection points 2024-05-12 18:53:06 +09:00
bin psql: Add missing punctuation in help output 2024-05-09 16:36:51 +02:00
common Fix overread in JSON parsing errors for incomplete byte sequences 2024-05-09 12:45:37 +09:00
fe_utils Fix an assortment of typos 2024-05-04 02:33:25 +12:00
include Introduce private data area for injection points 2024-05-12 18:53:06 +09:00
interfaces Translation updates 2024-05-06 12:06:31 +02:00
makefiles Optimize pg_popcount() with AVX-512 instructions. 2024-04-06 21:56:23 -05:00
pl Fix recursive RECORD-returning plpython functions. 2024-05-09 13:16:34 -04:00
port Fix code for probing availability of AVX-512. 2024-04-23 10:54:04 -05:00
template Remove AIX support 2024-02-28 15:17:23 +04:00
test injection_points: Store runtime conditions in private area 2024-05-12 19:42:26 +09:00
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools injection_points: Store runtime conditions in private area 2024-05-12 19:42:26 +09:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Update Unicode data to CLDR 45 2024-04-22 09:16:33 +02:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00