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

Tatsuo Ishii ishii at sraoss.co.jp
Mon Jan 30 15:23:54 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
------
master

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

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



More information about the pgpool-committers mailing list