Fix query cache lock file handling.
authorTatsuo Ishii <ishii@postgresql.org>
Thu, 4 Sep 2025 05:59:26 +0000 (14:59 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Thu, 4 Sep 2025 08:00:20 +0000 (17:00 +0900)
commita03106cea5632f06e595de0760d1131fab1ca926
tree157dcada4bf842d3799418439930227e67addaaa
parent8ecad5c45c2cedffa2e9e654286ab96aa4766f90
Fix query cache lock file handling.

Query cache module creates a lock file under logdir for concurrency
control. However, there were bugs in the handling:

1) Garbage file "QUERY_CACHE_LOCK_FILE" was created by pgpool main
   process.

2) The lock file was not removed upon pgpool shutdown.

This commit fixes the bugs.

Author: Tatsuo Ishii <ishii@postgresql.org>
Reported-by: Bo Peng <pengbo@sraoss.co.jp>
Reviewed-by: Bo Peng <pengbo@sraoss.co.jp>
Backpatch-through: v4.4
src/main/pgpool_main.c