[OpenAFS] Disconnected OpenAFS
Tue, 25 Sep 2007 09:31:17 -0400
> Could we have a disconnected mode for say just a user's $HOME
> directory. It's likely files in there won't change while they are
> offline. I run openafs client on my laptop and I use intermittent
> dialup internet access. It takes a long time to do an operation such
> as ls for the first time but then it's cached and is much faster, but
> the cache doesn't seem to last very long (around an hour or so).
> Anyway to optimize this offline mode for low bandwidth users in terms
> of reducing update size and lowering the time to do caching?
One of the use cases for disconnected mode is the $HOME directory case.
The AFS cache manager doesn't know what your $HOME directory is. To
the cache manager its just another directory tree. There will need to
be a UI for specifying what volumes, directories, and files you want to
synchronize. If you have a 200GB volume whose root is your $HOME
directory, it is unlikely that you want to access the entire thing in
disconnected mode. You will can to specify what you want.
The AFS cache contains both status information and file/directory data.
Provided that the file/directory data has not changed and has not been
forced out of the cache because the cache is full, the file/directory
data will not need to be re-read from the file servers.
What expires after an hour or so is the status information. The way
that AFS works is that the cache manager fetches status information from
the file server and receives a promise for a period a time that the file
server will notify the cache manager of any changes. This is referred
to as a callback. If the callback is revoked or if the callback
expires, the cache manager must fetch the status information again from
the file server.
The most important piece of status data for each object is the data
version. If the data version in the status for an object matches the
data version of the data buffers stored in the cache, then the data
buffers stored in the cache are valid and up to date. If the data
version does not match, the object's data buffers must be re-read from
the file server.
If you have a file system explorer such as Windows Explorer that insists
on opening every file/directory in a directory when displaying the
contents of a directory, performing a simple directory listing can be
There is another issue that can also delay the initial reads from a file
server. If the cache manager disconnected from the network without
notifying the file server that it should drop its callbacks and an
object for which there was a callback changed, then the file server will
attempt to break that callback the next time the cache manager
re-appears on the network. If the client changed IP addresses, the file
server must determine that the client moved and issue the callback to
the new address before other file operations can be performed.