Re: corrupt cache

From: Andreas Strotmann <Strotmann@dont-contact.us>
Date: Thu, 12 Jun 1997 17:00:14 +0200

On Jun 12, 16:08, Peter van Empel wrote:
> Subject: corrupt cache
>
> Then we looked in our cache.log and saw a lot of warnings:
> 97/06/05 10:42:23| storeSwapInHandle: WARNING: Object size mismatch.
> 97/06/05 10:42:23| --> 'http://cwis.kub.nl/~dbi/cwis/inf/index.htm'
> 97/06/05 10:42:23| --> Expecting 5330 bytes from file:
/cache/0A/53/0000053A
> 97/06/05 10:42:23| --> Only read 2328 bytes
> 97/06/05 10:42:23| storeSwapInHandle: WARNING: Object size mismatch.
> 97/06/05 10:42:23| --> 'http://cwis.kub.nl/~dbi/cwis/gifs/help.gif'
> 97/06/05 10:42:23| --> Expecting 1276 bytes from file:
/cache/0D/53/0000053D
> 97/06/05 10:42:23| --> Only read 1944 bytes
> 97/06/05 10:42:23| storeSwapInHandle: WARNING: Object size mismatch.
> 97/06/05 10:42:23| --> 'http://cwis.kub.nl/~drc/gifs/knoplhom.gif'
> 97/06/05 10:42:23| --> Expecting 1558 bytes from file:
/cache/07/19/00000197
> 97/06/05 10:42:23| --> Only read 6044 bytes
>
>
> This seems the problem. Squid is detecting that a certain objectsize is
not
> correct but still it served the files out. When it detects some
> inconsistencies it has to refresh it, or deny this request , but never
serve
> them out!
> A warning in a log is not enough, because at last a complete cache is
getting
> corrupt.
>
> In the past we had seen FATALS like:
> FATAL: Received Segment Violation...dying
> FATAL: Received Bus Error...dying
>

The last time I saw something like that (in a very early version of
Squid), this had happened:

A buffer overflow had overwritten the name field for the cache/log file,
causing the update for that file to be written to cache/<something_else>
instead of cache/log. After stopping and restarting Squid, an _old_
version of the cache/log file is then used -- namely, the one that had not
been overwritten.

So-- check for files with strange names in the place where your cache/log
file should reside, and perhaps move the most recent such file to
cache/log. (However, this is a solution only if you immediately recognize
the problem when it happens. Otherwise, you will probably need to delete
the cache/log and restart Squid.

I had the impression (when this happened last to me) that Squid indeed
refuses to serve items with size mismatches. Unfortunately, it sometimes
happens that an object is overwritten with one that has the same size.
 Given the typical size distribution and a huge cache (mine currently has
more than 500000 objects in it), this is quite likely to happen in a few
cases.

Hope this helps,

Andreas

-- 
Andreas Strotmann       / ~~~~~~ \________________A.Strotmann@Uni-Koeln.DE
Universitaet zu Koeln  /| University of Cologne   \
Regionales Rechenzentrum| Regional Computer Center \
Robert-Koch-Str. 10    /|    Tel: +49-221-478-5524 |\   Home: -221-4200663
D-50931  Koeln        __|__  FAX: +49-221-478-5590 |__________~~~~~~~~~~~~   
Received on Thu Jun 12 1997 - 08:03:11 MDT

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