[OpenAFS] best practice for salvage

John Hascall john@iastate.edu
Thu, 03 Apr 2008 14:32:25 CDT


> >> Since the file server has no way of knowing if the file is still in
> >> use it can't delete it.

> >    Why not?  Is there no way for the file server to query the
> >    cache manager and ask?

> The fact that the file is considered temporary is only known to the
> client.

     And to salvager :)

     So, the client has opened the file.  Doesn't this mean the
     the fileserver has a callback for this file/client?  Then
     the fileserver sees a RENAME op to the magic .__afsNNNN
     name.  Seems to me like it might be possible to pervert
     the callback to check up on the client/file.

     Your idea seems less icky. Besides typically the client
     just wrote the file, so it probably has most or all of it
     in it's cache anyway.  BUT, what do you do when it is
     too big to be entirely cached by the client?

John

> The only reason that the files are deleted at all by the Salvager
> is because the files were renamed to .__afsNNNN.  If the application
> had created temporary files with some other name and then disappeared
> without deleting them they would not be deleted by the salvager.
> 
> The way I would have implemented this functionality would be for the
> file to be moved into the local client's cache and removed from the
> file server since the file has now been unlinked and can therefore
> not be referenced by other clients.  It would then be the client's
> responsibility to clean up after itself.
> 
> Of course, even if we do implement this functionality in a future client
> revision we can't fix the clients that are already deployed.