2007-11-29 05:30:44

by Trond Myklebust

[permalink] [raw]
Subject: Re: [NFS] NFS Digest, Vol 18, Issue 70 (NFS performance problems)


On Thu, 2007-11-29 at 16:15 +1100, NeilBrown wrote:
> On Monday November 26, [email protected] wrote:
> >
> > (Stupid question: what would it take to give NFS the equivalent to
> > COMMIT for directory operations?)
>
> Interesting question.
>
> I guess the granularity would have to be per-directory. I think
> programs that need transactional behaviour for directory operations
> already need to call fsync on the directory, so that should be
> consistent with the current API.
>
> If DIR_COMMIT says "sorry, the server crashed", you need to replay the
> directory operations, which might be tricky in a number of cases.
> e.g. how do you replay a CREATE and be sure of getting the same
> fileid?
> How can you replay an UNLINK and be sure you deleted the right file
> and not some other file that some other client created since your
> UNLINK.
>
> It would probably be possible to manage something, but I don't think
> it would be as "simple" as COMMIT.

Actually, the real problem would be dealing with something like
unlink('foo') followed by open('foo', O_CREAT|O_EXCL). How do you ensure
that a replay of those actions following a reboot is fully consistent in
the face of some other client attempting an open('foo', O_CREAT) at the
same time?

The problem is that a number of directory operations involve exclusive
semantics, and so cannot be replayed. The solution to this sort of
problem is going to have to involve exclusive (i.e. write) directory
delegations to ensure that whatever transactions one client performs
cannot interfere with the transactions performed by another.

Trond


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
_______________________________________________
Please note that [email protected] is being discontinued.
Please subscribe to [email protected] instead.
http://vger.kernel.org/vger-lists.html#linux-nfs