[OpenAFS] best practice for salvage

Robert Banz rob@nofocus.org
Thu, 3 Apr 2008 12:55:30 -0700

> 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.

That wouldn't work, because the file could have been open()'d by two  
different cache managers, unlinked by one, but should still be able to  
be written to. AFS is basically handling the problem similar to the  
way that NFS did, and its always been a common to have .__nfs files  
stick around after some badness -- if you're sure you don't have long  
running applications sitting around, you could easily craft a low- 
intensity find() job to remove these. I recall running similar things  
on NFS servers periodically, which used atime as a guide.

Unfortunately, we have a lack of atime to contend with in AFS, so the  
job should probably have to keep state and remember which .__afs files  
it's seen before, and only remove them after a suitable timeframe has  
elapsed. Sounds like a rather trivial perl script to throw together.