]> git.ipfire.org Git - thirdparty/squid.git/commit
Allow a ufs cache_dir entry to coexist with a shared memory cache entry
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 25 Jul 2012 23:57:51 +0000 (17:57 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 25 Jul 2012 23:57:51 +0000 (17:57 -0600)
commit9e9dd16734312924388b3215148e5b77c43b94d5
tree9efb9d918e41f1b008e25e8c833280f4bf3e5867
parentc5fbbc7410d9187fd923a16d1b5f23e1384b58a0
Allow a ufs cache_dir entry to coexist with a shared memory cache entry
instead of being released when it becomes idle.

The original boolean version of the StoreController::dereference() code
(r11730) was written to make sure that idle unlocked local store_table entries
are released if nobody needs them (to avoid creating inconsistencies with
shared caches that could be modified in a different process).

Then, in r11786, we realized that the original code was destroying non-shared
memory cache entries if there were no cache_dirs to vote for keeping them in
store_table. I fixed that by changing the StoreController::dereference() logic
from "remove if nobody needs it" to "remove if somebody objects to keeping
it". That solved the problem at hand, but prohibited an entry to exist in
a non-shared cache_dir and in a shared memory cache at the same time.

We now go back to the original "remove if nobody needs it" design but also
give non-shared memory cache a vote so that it can protect idle non-shared
memory cached entries from being released if there are no cache_dirs to vote
for them.
src/store_dir.cc