DOC PREVIEW
Duke CPS 212 - Network File systems

This preview shows page 1-2-3-27-28-29 out of 29 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 29 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Hard State Revisited: Network FilesystemsHard State Revisited: Network FilesystemsJeff ChaseCPS 212, Fall 2000Network File System (NFS)Network File System (NFS)syscall layer*FSNFSserverVFSVFSNFSclient*FSsyscall layerclientuser programsRPC over UDP or TCPserverNFS VnodesNFS Vnodessyscall layer*FSNFSserverVFSRPCnetworknfsnodeNFS client stubsnfs_vnodeopsThe nfsnode holds client stateneeded to interact with the serverto operate on the file.struct nfsnode* np = VTONFS(vp);The NFS protocol has an operation type for (almost) everyvnode operation, with similar arguments/results.File HandlesFile HandlesQuestion: how does the client tell the server which file ordirectory the operation applies to?• Similarly, how does the server return the result of a lookup?More generally, how to pass a pointer or an object reference as anargument/result of an RPC call?In NFS, the reference is a file handle or fhandle, a token/ticketwhose value is determined by the server.• Includes all information needed to identify the file/object onthe server, and find it quickly.volume ID inode # generation #NFS: From Concept to ImplementationNFS: From Concept to ImplementationNow that we understand the basics, how do we make it fast?• cachingdata blocksfile attributeslookup cache (dnlc): name->fhandle mappingsdirectory contents?• read-ahead and write-behindfile I/O at wire speedAnd of course we want the full range of other desirable “*ility”properties....NFS as a “Stateless” ServiceNFS as a “Stateless” ServiceA classical NFS server maintains no in-memory hard state.The only hard state is the stable file system image on disk.• no record of clients or open files• no implicit arguments to requestsE.g., no server-maintained file offsets: read and write requestsmust explicitly transmit the byte offset for each operation.• no write-back caching on the server• no record of recently processed requests• etc., etc....Statelessness makes failure recovery simple and efficient.Recovery in Stateless NFSRecovery in Stateless NFSIf the server fails and restarts, there is no need to rebuild in-memory state on the server.• Client reestablishes contact (e.g., TCP connection).• Client retransmits pending requests.Classical NFS uses a connectionless transport (UDP).• Server failure is transparent to the client; no connection tobreak or reestablish.A crashed server is indistinguishable from a slow server.• Sun/ONC RPC masks network errors by retransmitting arequest after an adaptive timeout.A dropped packet is indistinguishable from a crashed server.Drawbacks of a Stateless ServiceDrawbacks of a Stateless ServiceThe stateless nature of classical NFS has compelling designadvantages (simplicity), but also some key drawbacks:• Recovery-by-retransmission constrains the server interface.ONC RPC/UDP has execute-at-least-once semantics (“send andpray”), which compromises performance and correctness.• Update operations are disk-limited.Updates must commit synchronously at the server.• NFS cannot (quite) preserve local single-copy semantics.Files may be removed while they are open on the client.Server cannot help in client cache consistency.Let’s explore these problems and their solutions...Problem 1: Retransmissions and IdempotencyProblem 1: Retransmissions and IdempotencyFor a connectionless RPC transport, retransmissions can saturatean overloaded server.Clients “kick ‘em while they’re down”, causing steep hockey stick.Execute-at-least-once constrains the server interface.• Service operations should/must be idempotent.Multiple executions should/must have the same effect.• Idempotent operations cannot capture the full semantics weexpect from our file system.remove, append-mode writes, exclusive createSolutions to the Retransmission ProblemSolutions to the Retransmission Problem1. Hope for the best and smooth over non-idempotent requests.E.g., map ENOENT and EEXIST to ESUCCESS.2. Use TCP or some other transport protocol that producesreliable, in-order delivery.higher overhead...and we still need sessions.3. Implement an execute-at-most once RPC transport.TCP-like features (sequence numbers)...and sessions.4. Keep a retransmission cache on the server [Juszczak90].Remember the most recent request IDs and their results, and justresend the result....does this violate statelessness?DAFS persistent session cache.Problem 2: Synchronous WritesProblem 2: Synchronous WritesStateless NFS servers must commit each operation to stablestorage before responding to the client.• Interferes with FS optimizations, e.g., clustering, LFS, anddisk write ordering (seek scheduling).Damages bandwidth and scalability.• Imposes disk access latency for each request.Not so bad for a logged write; much worse for a complexoperation like an FFS file write.The synchronous update problem occurs for any storageservice with reliable update (commit).Speeding Up Synchronous NFS WritesSpeeding Up Synchronous NFS WritesInteresting solutions to the synchronous write problem, usedin high-performance NFS servers:• Delay the response until convenient for the server.E.g., NFS write-gathering optimizations for clustered writes(similar to group commit in databases).Relies on write-behind from NFS I/O daemons (iods).• Throw hardware at it: non-volatile memory (NVRAM)Battery-backed RAM or UPS (uninterruptible power supply).Use as an operation log (Network Appliance WAFL)......or as a non-volatile disk write buffer (Legato).• Replicate server and buffer in memory (e.g., MIT Harp).NFS V3 Asynchronous WritesNFS V3 Asynchronous WritesNFS V3 sidesteps the synchronous write problem by adding anew asynchronous write operation.• Server may reply to client as soon as it accepts the write,before executing/committing it.If the server fails, it may discard any subset of the accepted butuncommitted writes.• Client holds asynchronously written data in its cache, andreissues the writes if the server fails and restarts.When is it safe for the client to discard its buffered writes?How can the client tell if the server has failed?NFSV3CommitNFSV3CommitNFSV3addsanewcommit operation to go with async-write.• Client may issue a commit for a file byte range at any time.• Server must execute all covered uncommitted writes beforereplying to the commit.• When the client receives the reply, it may safely discard anybuffered writes covered by the commit.• Server returns a verifier with every reply to an async write orcommit request.The


View Full Document

Duke CPS 212 - Network File systems

Download Network File systems
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Network File systems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Network File systems 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?