[OpenAFS-devel] Re: What is needed to build an AFS fileserver on top of BTRFS?

Jeffrey Hutzelman jhutz@cmu.edu
Tue, 17 Dec 2013 13:45:25 -0500


On Tue, 2013-12-17 at 17:47 +0000, David Howells wrote:
> Hugo Mills <hugo@carfax.org.uk> wrote:
> 
> > >  (1) 64-bit data version numbers that increase monotonically with
> > > each write. Yes, this is likely to cause some performance
> > > degredation as it introduces an ordering over data writes and
> > > metadata writes to a file. Maybe writes can be batched to improve
> > > performance?
> > 
> >    Do these have to be per-file? If not, then you might be able to get
> > away with using the transid, which is a filesystem-global
> > monotonically-increasing number.
> 
> Yes.  If you send a write RPC op to the server, you get back the new version
> number.  If the new version number is not the old version number + 1 you know
> there was a collision with a write from another client and you have to flush
> your cache for that file and request a new "callback" (ie. a promise to notify
> you if someone else changes the file).

Right.  So, the DV must increment by exactly one for each successful
StoreData (and not for other changes).  This is important because
clients cache data and metadata independently, and cached data is
labeled with the file's DV.  This means that even if metadata for a file
has to be refetched for some reason (for example, an expired callback),
the _data_ doesn't have to be refetched unless it has actually changed,
or been evicted from the client's cache due to cache pressure.

-- Jeff