[OpenAFS-devel] Re: Breaking callbacks on unlink

Troy Benjegerdes hozer@hozed.org
Sat, 25 Feb 2012 16:42:12 -0600


On Thu, Jan 26, 2012 at 04:34:59PM +0100, u-openafsdev-hk1a@aetey.se wrote:
> On Thu, Jan 26, 2012 at 10:09:04AM -0500, chas williams - CONTRACTOR wrote:
> > if i give you a calculator and it works fine except that square root
> > sometimes gives the wrong answer, would you use it?  did i forget to
> > tell you that the square root might be wrong?  how do you know when the
> > square root will give the right answer?  wouldn't you prefer to know
> > that square root will always be wrong instead of possibly right.
> > 
> > the argument with regard to breaking the callbacks is getting the same
> > behavior every time regardless of whether or not you like the result. i
> > would argue this should be the default and if there is any flag, it
> > should be "enable legacy unlink behavior that hinges upon what
> > you might have to done to precondition your local cache".
> 
> +1
> 
> Rune
> 

Let me propose the following:

1) on unlink, server broadcasts to all open callbacks something like 
the following: cache_unlink_or_forget_it(), which basically informs the
client that the file is being removed.

2) If the client has both of the following:
	a) disconnected operation
	b) sufficient cache space for the whole file

it can then pull the whole file into cache (or maybe must already have
the whole file cached), and then the server can break the callback, and
get rid of the file, and the client now has deterministic unix remove-it
on-close semantics


A possibly simpler approach is go ahead and break the callbacks on unlink,
and it's up to the client to make sure it's got enough cache space to keep
the whole file. Then it's the client's (and maybe sysadmin of the *client*)
to make sure there's enough space and something to ensure the files for 
which unix unlink semantics are important for will already be cached.


----------------------------------------------------------------------------
Troy Benjegerdes                 'da hozer'                hozer@hozed.org  
7 elements Farm						TerraCarbo biofuels

If you're going through hell, keep going. ~ Winston Churchill

The challenge in changing the world is not in having great ideas, it's in
having stupid simple ideas, as those are the ones that cause change.