PATCH (was Re: StoreDir rebuilding.)

From: Robert Collins <robert.collins@dont-contact.us>
Date: Mon, 30 Oct 2000 23:10:48 +1100

Please see the bottom for my response...

While we're on StoreDirs... I've attached the diff file for the completed
patch I was working on last week. I have not touched coss - I'm not across
that yet :-\.

Rob

----- Original Message -----
From: "Chemolli Francesco (USI)" <ChemolliF@GruppoCredit.it>
To: "'squid-dev'" <squid-dev@squid-cache.org>
Sent: Monday, October 30, 2000 9:38 PM
Subject: StoreDir rebuilding.

> I am unconvinced.
>
> I recently needed to rebuild one of my storedirs. To force a
> swap.state refresh, I removed it. This is the result:
>
> 2000/10/30 11:29:36| Rebuilding storage in /cache/d1 (CLEAN)
> 2000/10/30 11:29:36| Rebuilding storage in /cache/d2 (CLEAN)
> 2000/10/30 11:29:36| Rebuilding storage in /cache/d3 (CLEAN)
> 2000/10/30 11:29:36| Rebuilding storage in /cache/d4 (DIRTY)
> 2000/10/30 11:29:36| Rebuilding storage in /cache/d5 (CLEAN)
>
>
> I was surprised when I found out that
>
> -rw-r--r-- 1 squid squid 16061952 Oct 30 11:29 d1/swap.state
> -rw-r--r-- 1 squid squid 13228800 Oct 30 11:39 d1/swap.state.new
> -rw-r--r-- 1 squid squid 15248304 Oct 30 11:29 d2/swap.state
> -rw-r--r-- 1 squid squid 13215360 Oct 30 11:39 d2/swap.state.new
> -rw-r--r-- 1 squid squid 13818048 Oct 30 11:29 d3/swap.state
> -rw-r--r-- 1 squid squid 13215984 Oct 30 11:39 d3/swap.state.new
> -rw-r--r-- 1 squid squid 0 Oct 30 11:29 d4/swap.state
> -rw-r--r-- 1 squid squid 13020480 Oct 30 11:39 d4/swap.state.new
> -rw-r--r-- 1 squid squid 0 Oct 30 11:29 d5/swap.state
>
>
> ALL the swap.state files were being rebuilt.
> With a 20-something GB cache this is a slow operation.
> What is the rationale behind this? IMO this is at least a mis-feature,
> if not a bug.

Clean swap.state files get parsed and checked for consistency. With the
patch I threw up last week (re attached with Aufs and diskd patched as well)
the swap files used in the cache are also checked for existence and correct
size. If they are the wrong size they are removed.
When the checking is finished the swap.state.new is rotated onto swap.state.

For Dirty log files, the directory gets read, and swap.state.new is created
from the metadata within each file in the directory. When the directory is
read, the swap.state.new gets rotated onto swap.state.

I think it's ok, unless you want to assume you will never have swap.state !=
to the disk contents AND swap.state never internally inconsistent.

Rob

Received on Mon Oct 30 2000 - 05:05:53 MST

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