[pgpool-committers: 10168] pgpool: Fix bug in pcp_invalidate_query_cache.
Tatsuo Ishii
ishii at postgresql.org
Thu Oct 17 14:21:14 JST 2024
Fix bug in pcp_invalidate_query_cache.
Buildfarm reported 006.memqcache failure. This was caused by a mistake
in the test script (test.sh). It executes pcp_invalidate_query_cache
then compares the results of a query calling current_timestamp which
is already in query cache (using /*FORCE QUERY CACHE*/ comment). Since
pcp_invalidate_query_cache just places an invalidation request and
next query processes it, comparing the result right after execution of
"SELECT current_timestamp" with the previous cached result indeed
returns an equality and the test failed. To fix this, after
pcp_invalidate_query_cache, executes a different query.
Also I found the test not only fails, but sometimes causes timeout at
my local environment. Inspecting the remaining child process showed
that it is likely the SIGINT handler was not executed (variable
exit_request was not set). I suspect this is because
pool_clear_memory_cache(), which is responsible for actually clearing
the query cache, blocks all signal including SIGINT. I think this is
the reason why the signal handler for SIGINT is not executed. Since
pool_clear_memory_cache() already uses pool_shmem_lock() to protect
the operation on query cache, the signal blocking is not necessary. In
this commit I just removed calls to POOL_SETMASK2 and POOL_SETMASK.
Branch
------
master
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=f84c2a6345367bd6aee05b87dd5e573be724f715
Modified Files
--------------
src/query_cache/pool_memqcache.c | 4 ----
src/test/regression/tests/006.memqcache/test.sh | 1 +
2 files changed, 1 insertion(+), 4 deletions(-)
More information about the pgpool-committers
mailing list