[pgpool-committers: 9442] pgpool: Prevent query cache update under shared lock.

Tatsuo Ishii ishii at sraoss.co.jp
Wed Jun 14 11:29:03 JST 2023


Prevent query cache update under shared lock.

In https://www.pgpool.net/mantisbt/view.php?id=795 it was pointed out
that expired query cache entry can be modified under shared lock. This
could cause shared memory corruption used by query cache. In order to
fix this, we temporarily release the shared lock and then acquire an
exclusive lock before modifying the cache entry. This could create a
window and we need to get the cache entry meta data again to make sure
that the meta data has not been modified by someone else.

Back-patch to V4.4 stable where shared locking for query cache was
introduced.

Branch
------
master

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

Modified Files
--------------
src/query_cache/pool_memqcache.c | 37 +++++++++++++++++++++++++++++++------
1 file changed, 31 insertions(+), 6 deletions(-)



More information about the pgpool-committers mailing list