[PATCH] Make squid -z for cache_dir rock work like UFS, not COSS

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 04 Feb 2013 12:48:38 -0700

On 02/03/2013 10:06 PM, Alex Rousskov wrote:
> On 02/03/2013 08:31 PM, Amos Jeffries wrote:
>>> On 2/3/2013 8:29 PM, Alex Rousskov wrote:
>>>> To be consistent with ufs, we should probably change rock behavior from
>>>> initializing the database to doing nothing if the configured database
>>>> directory already exists. Like ufs, rock will rely on directory
>>>> existence for that test (regardless of what may be inside that
>>>> configured directory). In other words, squid-z is not "validate and
>>>> initialize" but "initialize if the configured directory is not there".
>>>>
>>>> Any objections to that rock change?

>> Absolutely none. Start by making both perform an existence check before
>> doing *anything*.
>> * initialize if it does not exist yet

> Will do.

The attached trunk patch makes squid -z for cache_dir rock work like UFS
instead of like COSS.

When a startup script runs squid -z by mistake against a cache_dir that
is already initialized and full of cached entries, some admins prefer
that nothing happens. Rock store now skips reinitialization if both the
cache_dir directory and the db file in that directory exist. If one or
both are missing, the missing pieces are created.

UFS does something similar because it creates missing L1 and L2
directories but does not erase any entries already present in the
cache_dir path. COSS, OTOH, re-initializes the existing db (but nobody
noticed or complained loud enough, apparently). Rock behavior will now
be closer to UFS.

To clean a corrupted cache_dir, the admin must remove it before running
squid-z.

Thank you,

Alex.

Received on Mon Feb 04 2013 - 19:48:47 MST

This archive was generated by hypermail 2.2.0 : Tue Feb 05 2013 - 12:00:05 MST