Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier2025-05-09 21:56:26 +0000
committerMichael Paquier2025-05-09 21:56:26 +0000
commit371f2db8b05e4d46cbf489f05cbfc4d6ed6976d4 (patch)
treeaf10abf135f4a14534d31c7d8f95d7bed9b4e949 /src/backend/utils/cache
parent89372d0aaa4a6f0e560acdf9014c5ad66fdde1b1 (diff)
Add support for runtime arguments in injection points
The macros INJECTION_POINT() and INJECTION_POINT_CACHED() are extended with an optional argument that can be passed down to the callback attached when an injection point is run, giving to callbacks the possibility to manipulate a stack state given by the caller. The existing callbacks in modules injection_points and test_aio have their declarations adjusted based on that. da7226993fd4 (core AIO infrastructure) and 93bc3d75d8e1 (test_aio) and been relying on a set of workarounds where a static variable called pgaio_inj_cur_handle is used as runtime argument in the injection point callbacks used by the AIO tests, in combination with a TRY/CATCH block to reset the argument value. The infrastructure introduced in this commit will be reused for the AIO tests, simplifying them. Reviewed-by: Greg Burd <greg@burd.me> Discussion: https://postgr.es/m/Z_y9TtnXubvYAApS@paquier.xyz
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/catcache.c2
-rw-r--r--src/backend/utils/cache/inval.c2
-rw-r--r--src/backend/utils/cache/typcache.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index 6e3cad454c0..657648996c2 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -1926,7 +1926,7 @@ SearchCatCacheList(CatCache *cache,
/* Injection point to help testing the recursive invalidation case */
if (first_iter)
{
- INJECTION_POINT("catcache-list-miss-systable-scan-started");
+ INJECTION_POINT("catcache-list-miss-systable-scan-started", NULL);
first_iter = false;
}
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index fa7b4d7e303..02505c88b8e 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -1207,7 +1207,7 @@ AtEOXact_Inval(bool isCommit)
/* Must be at top of stack */
Assert(transInvalInfo->my_level == 1 && transInvalInfo->parent == NULL);
- INJECTION_POINT("transaction-end-process-inval");
+ INJECTION_POINT("transaction-end-process-inval", NULL);
if (isCommit)
{
diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c
index e359da09ec9..f9aec38a11f 100644
--- a/src/backend/utils/cache/typcache.c
+++ b/src/backend/utils/cache/typcache.c
@@ -952,7 +952,7 @@ lookup_type_cache(Oid type_id, int flags)
load_domaintype_info(typentry);
}
- INJECTION_POINT("typecache-before-rel-type-cache-insert");
+ INJECTION_POINT("typecache-before-rel-type-cache-insert", NULL);
Assert(in_progress_offset + 1 == in_progress_list_len);
in_progress_list_len--;