[pgpool-committers: 9142] pgpool: Obtain stronger lock while commiting shared relcache.

Tatsuo Ishii ishii at sraoss.co.jp
Mon Jan 30 15:23:24 JST 2023


Obtain stronger lock while commiting shared relcache.

Previously pool_search_relcache() obtained only shared lock, which is
not safe enough to call pool_catalog_commit_cache() because it
registers new cache entry. Unfortunately our locking system does not
allow to escalate a shared lock to an exclusive lock. So we release
the shared lock then acquire the exclusive lock before calling
pool_catalog_commit_cache(). There's a window between them and we may
end up with an effort to register duplicate cache entry. But
underlying infrastructure of the query system will reject it and
should be safe.

Back-patch through 4.4 where the shared locking of the query cache
system was introduced.

Branch
------
V4_4_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=93f55858c6ba8b5243f5dc79808926961d78d826

Modified Files
--------------
src/utils/pool_relcache.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)



More information about the pgpool-committers mailing list