disconnected operation in the coda file system j. j. kistler m. sataynarayanan carnegie-mellon...

39
DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Upload: amber-williamson

Post on 04-Jan-2016

219 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

DISCONNECTED OPERATION IN THE CODA FILE SYSTEM

J. J. KistlerM. Sataynarayanan

Carnegie-Mellon University

Page 2: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Paper Highlights

• An overview of Coda• How Coda deals with disconnected operation

– File hoarding• The paper mentions but does not discuss

– Callbacks (covered in my presentation)– Weakly connected operation

Page 3: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

CODA

• Successor of the very successful Andrew File System (AFS)– First DFS aimed at a campus-sized user

community• Key ideas include

– open-to-close consistency– callbacks

Page 4: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

General Organization (I)

• Coda is tailored to access patterns typical of academic and research environments– Little sharing

• Not intended for applications exhibiting highly concurrent file granularity data access

This lack of sharing is typical of UNIX file systemaccess patterns

Page 5: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

General Organization (II)

• Clients view Coda as a single location-transparent shared Unix file system– Complements local file system

• Coda namespace is mapped to individual file servers at the granularity of subtrees called volumes

• Each client has a cache manager (VICE)

Page 6: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

General Organization (III)

• High availability is achieved through– Server replication:

• Set of replicas of a volume is VSG(Volume Storage Group)

• At any time, client can access AVSG (Available Volume Storage Group)

– Disconnected Operation: • When AVSG is empty

Page 7: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Design Rationale

• CODA major objectives were– Using off-the-shelf hardware– Preserving transparency

• Other considerations included– Need for scalability– Advent of portable workstations– Hardware model being considered– Balance between availability and consistency

Page 8: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Scalability

• AFS was scalable because– Clients cache entire files on their local disks– Cache coherence is maintained by the use of

callbacks, which reduce server involvement art open time• Clients do most of the work

• Coda adds replication

Page 9: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Portable Workstations

• Laptops of the late 80’s had very small disk drives– Users were manually caching the files they

planned to use while being disconnected• Coda has a single mechanism to handle

– Voluntary disconnections– Involuntary disconnections

Page 10: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Hardware Model

• CODA and AFS assume that client workstations are personal computers controlled by their user/owner– Fully autonomous– Cannot be trusted

• CODA allows owners of laptops to operate them in disconnected mode– Opposite of ubiquitous connectivity

Page 11: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Other Models

• Plan 9 and Amoeba– Computing is done by pool of servers– Workstations are just display units

• NFS and XFS– Clients are trusted and always connected

• Farsite– Untrusted clients double as servers

(much more recent)

Page 12: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Accessibility

• Must handle two types of failures– Server failures:

• Data servers are replicated– Communication failures and voluntary

disconnections• Coda uses optimistic replication and

file hoarding

Page 13: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

What about Consistency?

• Pessimistic replication control protocols guarantee the consistency of replicated in the presence of any non-Byzantine failures– Typically require a quorum of replicas to allow

access to the replicated data– Would not support disconnected mode

Page 14: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Example

• Majority consensus voting:– Every update must involve a majority of

replicas– Every majority contains at least one replica

that was involved in the previous update

2 3 3

Page 15: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Pessimistic Replica Control

• Would require client to acquire exclusive (RW) or shared (R) control of cached objects before accessing them in disconnected mode:– Acceptable solution for voluntary disconnections– Does not work for involuntary disconnections

• What if the laptop remains disconnected for a long time?

Page 16: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Leases

• We could grant exclusive/shared control of the cached objects for a limited amount of time

• Works very well in connected mode – Reduces server workload– Server can keep leases in volatile storage as

long as their duration is shorter than boot time• Would only work for very short disconnection

periods

Page 17: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Optimistic Replica Control (I)

• Optimistic replica control allows access in every disconnected mode– Tolerates temporary inconsistencies– Promises to detect them later– Provides much higher data availability

Page 18: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Optimistic Replica Control (II)

• Defines an accessible universe: set of replicas that the user can access– Accessible universe varies over time

• At any time, user– Will read from the latest replica(s) in his accessible

universe– Will update all replicas in his accessible universe–

Page 19: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

IMPLEMENTATION

• Client structure• Venus states• Hoarding• Prioritized cache management• Hoard walk• Persistence• Reintegration

Page 20: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Client Structure

System call interface

Vnode interfaceCoda MiniCache

(handles local accesses)

ApplicationVenus

(connects with Coda servers)

Page 21: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Venus States (I)

1. Hoarding:Normal operation mode

2. Emulating:Disconnected operation mode

3. Reintegrating:Propagates changes and detects inconsistencies

Page 22: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Venus States (II)

Hoarding

Emulating Recovering

Page 23: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Prioritized Cache Management

• Coda maintains a per-client hoard database (HDB) specifying files to be cached on client workstation

– Client can modify HDB and even set up hoard profiles

– Hoard entry may include a hoard priority• Actual priority is function of hoard priority and

recent usage

Page 24: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Hoard Walking

• Must ensure that no uncached object has a higher priority than a cached object

• Since priorities are function of recent usage, they vary over time

• Venus reevaluates priorities every ten minutes (hoard walk)– Hoard walk can also be requested by user,

say, before a voluntary disconnection

Page 25: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Emulation

• In emulation mode:– Attempts to access files that are not in the

client caches appear as failures to application

– All changes are written in a persistent log,the client modification log (CML)

– Venus removes from log all obsolete entries like those pertaining to files that have been deleted

Page 26: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Persistence

• Venus keeps its cache and related data structures in non-volatile storage

• All Venus metadata are updated throughatomic transactions– Using a lightweight recoverable virtual

memory (RVM) developed for Coda– Simplifies Venus design

Page 27: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Reintegration

• When workstation gets reconnected, Coda initiates a reintegration process– Performed one volume at a time– Venus ships replay log to all volumes– Each volume performs a log replay algorithm

• Found later that it required a fast link between workstation and servers

Page 28: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

STATUS AND EVALUATION

• Reintegration can be time-consuming– requires very large data transfers

• One hundred MB is enough for the cache size• Conflicts are infrequent

– At most 0.75% to have same file updated by two different users less than one day apart

Page 29: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Future Work

• Coda added later a weak connectivity mode for portable computers linked to the CODA servers through slow links (like modems)– Allows for slow reintegration

Page 30: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

SESSION SEMANTICS AND CALLBACKS

• The paper does not cover the issue of session semantics and the role of callbacks– Essential part sof AFS design– Adopted by Coda

Page 31: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

UNIX sharing semantics

• Centralized UNIX file systems provide one-copy semantics– Every modification to every byte of a file is

immediately and permanently visible to all processes accessing the file

• AFS uses a open-to-close semantics• Coda uses an even laxer model

Page 32: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Open-to-Close Semantics (I)

• First version of AFS– Revalidated cached file on each open– Propagated modified files when they were

closed• If two users on two different workstations modify

the same file at the same time, the users closing the file last will overwrite the changes made by the other user

Page 33: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Open-to-Close Semantics (II)

• Example:

TimeF

F’

F’

F”

F”

First client

Second Client

F” overwrites F’

Page 34: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Open to Close Semantics (III)

• Whenever a client opens a file, it always gets the latest version of the file known to the server

• Clients do not send any updates to the server until they close the file

• As a result– Server is not updated until file is closed– Client is not updated until it reopens the file

Page 35: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Callbacks (I)

• AFS-1 required each client to call the server every time it was opening an AFS file– Most of these calls were unnecessary as user

files are rarely shared• AFS-2 introduces the callback mechanism

– Do not call the server, it will call you!

Page 36: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Callbacks (II)

• When a client opens an AFS file for the first time, server promises to notify it whenever it receives a new version of the file from any other client– Promise is called a callback

• Relieves the server from having to answer a call from the client every time the file is opened– Significant reduction of server workload

Page 37: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Callbacks (III)

• Callbacks can be lost!

– Client will call the server every tauminutes to check whether it received all callbacks it should have received

– Cached copy is only guaranteed to reflect the state of the server copy up to tau minutes before the time the client opened the file for the last time

Page 38: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

Coda semantics

• Client keeps track of subset s of servers it was able to connect the last time it tried

• Updates s at least every tau seconds • At open time, client checks it has the most

recent copy of file among all servers in s– Guarantee weakened by use of callbacks– Cached copy can be up to tau minutes behind

the server copy

Page 39: DISCONNECTED OPERATION IN THE CODA FILE SYSTEM J. J. Kistler M. Sataynarayanan Carnegie-Mellon University

CONCLUSION

• Coda– Puts scalability and availability before

data consistency• Unlike NFS

– Assumes that inconsistent updates are very infrequent

– Introduced disconnected operation mode and file hoarding