coda/afs (constant data availability) --jay n. vyas & naveen mohan--

25
CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Post on 19-Dec-2015

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

CODA/AFS(Constant Data Availability)

--Jay N. Vyas & Naveen Mohan--

Page 2: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Background

CODA is what? – A Distributed File System (DFS)

Developed by? – Mahadev Satyanarayanan

Where & Why? – At Carnegie Mellon University as a Research Project in 1987

Page 3: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

CODA/AFS - Introduction

A decentralized distributed file system (DFS) to be accessed from autonomous workstations.

Derived from AFS (Andrew File System) and inherits many of the core features.

AFS was a very successful DFS for a campus-sized user community.

Was planned to be extended at a national level but WWW took over instead.

Key ideas of AFS include:

Close-to-open consistency

Callbacks

Page 4: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Design Motto

CODA had three fundamental objectives:

Scalability - to build a system that can easily cope with addition of users and sites

Fault-Tolerance - to remain usable in the advent of server failures, communication failures and voluntary disconnections

Unix Emulation – to make Coda appear as a giant failure-proof shared Unix file system

Page 5: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Key Features

How is CODA different from AFS then? - Fault Tolerance!

Provides “constant availability” through Replication

Introduces a “disconnected mode” for portable computers (Mobile Computing)

Supplementary Features:

Is freely available under a Liberal License (Source Code is accessible)

High Performance through Client side persistent caching

Uninterrupted service during partial network failures

Highly Scalable

Provides Unified file sharing using well defined semantics even in the event of network failures

Page 6: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

History: AFS-1 semantics

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 7: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Open-to-Close Semantics

Example:

TimeF

F’

F’ F”

First client

Second client

F” overwrites F’

TimeF

F’

F’

F”

F”

First client

Second client

F” overwrites F’

Page 8: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

AFS-2 semantics

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!

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 9: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

AFS-2 semantics (Contd..)

Callbacks can be lost!

Client will call the server every tau minutes 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 10: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

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

Cached copy can be up to tau minutes behind the server copy

Conflicts between cached copy and most recent copy in s can happen

Coda guarantees they will always be detected

At close time, client propagates the new version of the file to all servers in s

If s is empty. client marks the file for later propagation

Page 11: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Server Replication

Data structures:

Volume

A set of files and directories located on one server (shared)

Each file and directory in Coda has a unique low-level file identifier (FID). All replicas of an object has the same FID.

VSG (Volume Storage Group):

Set of servers storing replicas of a volume.

AVSG (Accessible Volume Storage Group):

Venus (client cache manager) keeps track of the subset of servers accessible to the client for every volume the client has cached.

Preferred Server:

One of the AVSG servers of the client, that it accesses during a cache miss. Chosen based on physical proximity, server load or server CPU power.

Holds all callbacks for client & answers all the read – write requests from client.

Page 12: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Server Replication(contd..)

Strategy

Read – any , Write – all approach

Client still checks with other servers (in AVSG) to find which one has the latest version/copy of the data.

When a file is closed after modification by a client it is transferred in parallel to all members of the AVSG.

Minimizes Server CPU load

Improved scalability, since Server is the bottleneck in many distributed file systems.

Cache Coherence – Client identifies 3 types of events no later than Τ seconds,

Enlargement of AVSG – Accessibility of a previously inaccessible server.

Shrinking of AVSG – Inaccessibility of a previously accessible server.

Lost Callback event

Coda Version Vector ( CVV )

A volume CVV is similar to a file or directory CVV, but summarizes update information on the entire volume.

Page 13: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Parallel Communication

Replication requires multiple sites to be contacted.

If serialized, latency would be degraded intolerably.

MultiRPC - parallel remote procedure call mechanism which were previously used was extended to use hardware multicast to reduce the latency and network load.

Page 14: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Versioning vector (Coda Version Vector) when partition happens: [1,1,1]

Client A updates file versioning vector in its partition: [2,2,1]

Client B updates file versioning vector in its partition: [1,1,2]

Partition repaired compare versioning vectors: conflict!

Server Replication (Conflict Scenario)

Page 15: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Conflict Resolution Conflict Detection

Coda does not prevent inconsistent updates but guarantees that inconsistent updates will always be detected

Automated Resolution

All directory conflicts are automatically resolved by a compensating sequence of create or delete operations, except

Update/update conflict

Remove/update conflict

Name/name conflict

Damage Containment

Marks all accessible replicas of the objects inconsistent. (if can’t be automatically resolved).

Repair Tool (Manual)

Special Interface to Venus (Client Cache Manger)

Enables the tool to overwrite inconsistent files and to perform directory operations on inconsistent directories, subject to normal access restrictions

Page 16: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Server Replication - Performance

Page 17: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Introducing Mounting Operation

The Andrew file system, Coda's predecessor, pioneered the idea and stored all files under /afs.

A client (user) connects to “Coda” and not to individual servers; but the latter come into play invisibly.

All the files, which any of the servers may provide to the client, are available under the /coda directory, and all clients see the same name space.

Why is Single mount point (name space) advantageous:

Users will see the same file tree

Auto-discovery of new servers and shares by the Client machines in /coda tree

Page 18: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

CODA Operation – Disconnection Mode

How does it provide services when the Network crashes?

Scenario:

User wants to open a file “foo” – cat /coda/tmp/foo

A System call is generated to the kernel and it looks for inode of the file which returns the file handle associated with that program (what is inode? RECALL!)

Open call proceeds to the Virtual File System (VFS) (What is VFS?) which is handed to the Coda File system present on the Kernel

CFS in turn “may” forward the request to “Venus” (What is Venus? RECALL!)

Venus checks first in the client cache for /tmp/foo, if cache-miss, then contacts the Vice servers.

After successful file location, Venus responds back to the kernel with info which returns to the calling program.

Page 19: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Fig. The Architecture

Page 20: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

When does Disconnection Mode crank up?

Possibilities:

When there is no network connection to any server which has the files.

Happens for laptops when taken off the network, or during network failures.

Or if the servers fail.

Page 21: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

And how does it work? (Caching)

Entire file fetched from the servers and stored as a container file in the local cache area by Venus on receiving the first kernel request

(currently/usr/coda/venus.cache/).

If the file is opened a second time or R/W operations performed, local copy is only used.

If it’s modified and closed, then Venus updates the servers by sending the new file.

Operations like making directories, removing files or directories and creating or removing (symbolic) links are propagated to the servers also.

Page 22: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

From Caching to Disconnection

Servers synchronously updated with modified files in normal connection mode

Time-out occurs if Server unavailable or Network failure

The Ball Begins to Roll!!! (Activate Disconnect Mode)

Instead of instantly updating the user with time-out, Venus logs all updates in CML (Client Modification Log); frequently flushed to the disk

Upon reconnection of the network, CML file is reintegrated with the server– Run Updates

Another Fault Tolerance feature achieved with crisp Transparency…

Page 23: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

Issues with disconnected operation

Hoarding Files

Unable to serve cache-misses during network anomaly

Hence Stack up updates to the important files on local cache (client side)

Known as “Hoard Walk”

Client/Server Conflict

Multiple clients may have modified the file during disconnect mode to CML.

Needs Repair – either Automatically (Resolvers) with rare chances of Human intervention

Page 24: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

CONCLUSION & Paper Highlights

Coda project had an unusually long life First work to introduce disconnected mode

Server Replication resulting in increased System resiliency

Coda/AFS introduced many new ideas Close-to-open consistency

Optimistic concurrency control

Callbacks (partially superseded by leases)

Page 25: CODA/AFS (Constant Data Availability) --Jay N. Vyas & Naveen Mohan--

References

Coda File System: http://www.coda.cs.cmu.edu

"The Coda Distributed File System." The Coda Distributed File System. N.p., n.d. Web. 11 Mar. 2015.URL: http://www.coda.cs.cmu.edu/ljpaper/lj.html

Mahadev Satyanarayanan; Kistler, J.J.; Kumar, P.; Okasaki, M.E.; Siegel, E.H.; Steere, D.C., "Coda: a highly available file system for a distributed workstation environment," Computers, IEEE Transactions on, vol.39, no.4, pp.447,459, Apr 1990doi: 10.1109/12.54838URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=54838&isnumber=1979