Re: Cache index mangled?

From: Stewart Forster <slf@dont-contact.us>
Date: Wed, 05 Nov 1997 13:39:30 +1100

Hi All,

        I implemented the re-usable cache log files (ie. no unlink - just write
over the top of the old file) independently to the mainstream squid code. I
noticed that when a cache was restarted however after it had died abnormally,
the would be a race condition that while the cache was reading through the old
index log file, that if someone referred to an URL whose cache log file had
subsequently been written over (by porn perhaps) then this situation would
arise. It may be that since you've upgraded squid this situation hasn't
come about yet for those have noted it hasn't happened since 1.1.14.

        I don't know what has been done to fix this problem in the current
versions of squid, but for us, the only true fix was to NOT serve anything
from disk (newly pulled in hot memory objects are OK) until the entire cache
log file had been reread, giving squid a chance to evict the invalid URL to
cache log file mappings.

        This may seem expensive but the reread only takes 15 minutes for us
(2.5 million URLS) so we decided it was small price for the rare event when
squid dies without rewriting a clean swap log file.

        Can someone confirm if the newer versions of squid have fixed this
problem, and if not, I'll send my patches.

        Cheers,

                Stew.
Received on Tue Nov 04 1997 - 18:48:17 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:37:27 MST