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

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 05 Feb 2013 17:15:38 +1300

On 5/02/2013 8:48 a.m., Alex Rousskov wrote:
> 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.

+1. Although when comitting can you add a few words to the -z
description in main.cc usage() function and src/squid.8.in man file, so
that it is clear this only a create-if-missing action.

Amos
Received on Tue Feb 05 2013 - 04:15:48 MST

This archive was generated by hypermail 2.2.0 : Fri Feb 08 2013 - 12:00:07 MST