[squid-users] Re: ordering in rebuilt swap.state

From: RW <rwmaillists_at_googlemail.com>
Date: Thu, 26 Jan 2012 14:25:57 +0000

On Thu, 26 Jan 2012 18:47:10 +1300
Amos Jeffries wrote:

> > I assumed that part of the point of having a journal was that
> > reading it in sequentially would lru order the queue when squid
> > starts up.
>
> You are right. I checked the code and it uses the policy list to dump
> the clean journal.

> > I was referring to deleting swap.state when squid isn't running, in
> > which case it's recreated from the cache files.
>
> If you do this erase you will loose the LRU atime details in the
> journal.

Right, that's what I was saying when I said "I'm guessing that the
rebuild had already been done automatically".

My theory is that that an unclean shutdown, or something, caused
swap.state to be lost or corrupted, forcing squid to read in the objects
in the cache. Presumably the lru queue would then get filled in
hexadecimal path/filename order, which would account for the bogus LRU
reference ages.

The reason that I tried a manual slow rebuild first is that it seemed
very likely to be lru corruption and I though there was a small chance
that squid might do a sort on a slow rebuild. The fact that the
reference age didn't change at all suggested that squid had already done
its own slow rebuild on a previous restart.

If the files are read in hexadecimal order then it should be fairly
straightforward to repair the lru information by reordering the files
in the cache by mtime and having squid reread them.
Received on Thu Jan 26 2012 - 14:26:17 MST

This archive was generated by hypermail 2.2.0 : Fri Jan 27 2012 - 12:00:03 MST