Distributed File Systems: Arvind Krishnamurthy Spring 2001
Distributed File Systems: Arvind Krishnamurthy Spring 2001
1
Caching Motivation, part 1: Failures
n Idea: use caching to reduce network load n What if server crashes? Can client wait until server comes
n Cache file blocks, file headers, etc., at both clients and servers: back up, and continue as before?
n Client memory n Any data in server memory, but not yet on disk can be lost
Server memory
n
n Shared state across RPCs:
n Advantage: if open/read/write/close can be done locally, no network n Example: open, seek, read
traffic n What if server crashes after seek?
n Issues: failures and cache consistency n Client does “read”, it will fail
S
n What if client crashes?
Cache Client n Might lose modified data in client cache
requests immediately, as if nothing happened n Return an error? Problem is most applications don’t know they
2
NFS Summary Andrew File System
n Pros: n AFS (CMU, late 80’s) à DCE Distributed File Systems
n Simple n Callbacks: server records who has copy of file
n Highly portable n Write through on close
n If file changes, server is updated on close
Server then immediately tells all those with the old copy
Cons:
n
n
n Session semantics: updates visible only on close
n Sometimes inconsistent
n Unix: updates visible immediately to other programs who have the file
n Does not scale to large number of clients open
n AFS: everyone who has file open sees old version; anyone who opens
file again will see new version
n AFS:
n On open and cache miss: get file from server, set up callback
n On write close: send copy to server; tells all clients with copies to fetch
new version from server on next open
Hoarding Consistency
n AFS keeps recently used files on local disk n What if two disconnected users write the same file at the
n Most of what you need will be around same time?
n No way to use callback promises since server and client cannot
n Users can specify “hoard lists” to tell Coda to cache a communicate
bunch of other things even if not already stored locally n Coda’s solution: cross your fingers, hope it does not
happen, and pick up pieces if it does
n Log of changes kept while disconnected
n System can also learn over time which files a user tends to
n Apply changes upon reconnect
use
n If conflict detected, try to resolve automatically, else ask the user
n In practice, unfixable conflicts almost never happen