This is not a DFS newsgroup, but since Marcus Watts has mentioned DFS in his
discussion of this interesting topic, I'll clarify how DFS addresses this
problem.

A DFS server will not delete a file until and unless it thinks that there are
no more references to it on clients.  It keeps track of client references using
"tokens".  A token represents a promise of some sort made to a client.
One of the first steps in trying to delete a file is to try to revoke tokens
for that file.  The server does this by making token-revocation RPC's to
clients.  If all the RPC's succeed, the file will be deleted.

In some early versions of DFS, the relevant tokens were "open tokens", the
tokens requested by clients when doing an open system call.  Thus, a file could
be deleted if no client was holding it open.  More recently, DFS uses
"preserve tokens".  A client requests a preserve token when it first gets a
reference to a file, and holds it as long as there is a reference, even if
the file is not open.  The difference is not usually important, but when there
are concurrent processes accessing a file, some problematical racing behavior
is avoided by using preserve tokens instead of open tokens to govern deletion.

If a server thinks that a client is "down" (either the client really is down,
or there is some network failure), it doesn't try to make an RPC to the client,
but treats the token as immediately revoked.  Likewise, if a token-revocation
RPC fails and the failure is due to a communication failure, the RPC is
considered to have succeeded.  Thus one client is not prevented from accessing
a file due to failure of another client.

This implements a file-sharing semantics that is roughly equivalent to
single-processor Unix, that is, any process may unlink a file, and other
processes that are accessing the file will continue to do so undisturbed,
for as long as they hold it.

DFS tokens are similar to AFS callbacks, and the reader may ask why AFS does
not implement these semantics.  The difference is that AFS callbacks are
similar to DFS data tokens, but there is nothing in AFS similar to DFS open
tokens or preserve tokens.  (I welcome correction if I am giving an erroneous
or incomplete picture of AFS.)



Reply via email to