DOC PREVIEW
Princeton COS 318 - NSF, Snapshot, Dedup and Review

This preview shows page 1-2-3-25-26-27 out of 27 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 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 27 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 27 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 27 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 27 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 27 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

COS 318: Operating SystemsNSF, Snapshot, Dedup and Review2Topics!NFS!Case Study: NetApp File System!Deduplication storage system!Course review3Network File System!Sun introduced NFS v2 in early 80s!NFS server exports directories to clients!Clients mount NFS server’s exported directories (auto-mount is possible)!Multiple clients share a NFS serverNetworkNFS serverClients4NFS Protocol (v3)1. NULL: Do nothing2. GETATTR: Get file attributes3. SETATTR: Set file attributes4. LOOKUP: Lookup filename5. ACCESS: Check Access Permission6. READLINK: Read from symbolic link7. READ: Read From file8. WRITE: Write to file9. CREATE: Create a file10. MKDIR: Create a directory11. SYMLINK: Create a symbolic link12. MKNOD: Create a special device13. REMOVE: Remove a File14. RMDIR: Remove a Directory15. RENAME: Rename a File or Directory16. LINK: Create Link to an object17. READDIR: Read From Directory18. READDIRPLUS: Extended read from directory19. FSSTAT: Get dynamic file system information20. FSINFO: Get static file system Information21. PATHCONF: Retrieve POSIX information22. COMMIT: Commit cached data on a server to5NFS Protocol!No open and close"Server doesn’t really know what clients are doing, who has files open, etc!Use a global handle in the protocol"Read some bytes"Write some bytes!Questions"What is stateless?"Is NFS stateless?"What is the tradeoffs of stateless vs. stateful?6NFS ImplementationVirtual file systemClient kernelLocalFSLocalFSNFSclientBuffer cacheVirtual file systemLocalFSLocalFSNFSserverBuffer cacheNFS Server Network7NFS Client Caching Issues!Client caching"Read-only file and directory data (expire in 60 seconds)"Data written by the client machine (write back in 30 seconds)!Consistency issues"Multiple client machines can perform writes to their caches"Some cache file data only and disable client caching of a file if it is opened by multiple clients"Some implement a network lock manager8NFS Protocol Development!Version 2 issues"18 operations"Size: limit to 4GB file size"Write performance: server writes data synchronously"Several other issues!Version 3 changes (most products still use this one)"22 operations"Size: increase to 64 bit"Write performance: WRITE and COMMIT"Fixed several other issues"Still stateless!Version 4 changes"42 operations"Solve the consistency issues"Security issues"Stateful9Case Study: NetApp’s NFS File Server!WAFL: Write Anywhere File Layout"The basic NetApp’s file system!Design goals"Fast services (fast means more operations/sec and higher bandwidth)"Support large file systems and allow growing smoothly"High-performance software RAID"Restart quickly after a crash!Special features"Introduce snapshots"Use NVRAM to reduce latency and maintain consistency10Snapshots!A snapshot is a read-only copy of the file system"Introduced in 1993"It has become a standard feature of today’s file server!Use snapshots"System administrator configures the number and frequency of snapshots"An initial system can keep up to 20 snapshots"Use snapshots to recover individual files!An examplearizona% cd .snapshotarizona% lshourly.0 hourly.2 hourly.4 nightly.0 nightly.2 weekly.1hourly.1 hourly.3 hourly.5 nightly.1 weekly.0arizona%!How much space does a snapshot consume?"10-20% space per week11i-node, Indirect and Data Blocks!WAFL uses 4KB blocks"i-nodes (evolved from UNIX’s)"Data blocks!File size < 64 bytes"i-node stores data directly!File size < 64K bytes"i-node stores 16 pointers to data!File size < 64M bytes"i-node stores 16 pointers to indirect blocks"Each indirect pointer block stores 1K pointers to dataData Data DataData DataData12WAFL Layout!A WAFL file system has"A root i-node: root of everything"An i-node file: contains all i-nodes"A block map file: indicates free blocks"An i-node map file: indicates free i-nodes"Data files: real files that users can seeMetadatain files13Why Keeping Metadata in Files!Allow meta-data blocks to be written anywhere on disk"This is the origin of “Write Anywhere File Layout”"Any performance advantage?!Easy to increase the size of the file system dynamically"Adding a disk can lead to adding i-nodes!Enable copy-on-write to create snapshots"Fixed metadata locations are cumbersome"Copy-on-write new data and metadata to any new disk locations14Snapshot Implementation!WAFL file system is a tree of blocks!Snapshot step 1"Replicate the root i-node"New root i-node is the active file system"Old root i-node is the snapshot!Snapshot step 2…n"Copy-on-write blocks to the root"Active root i-node points to the new blocks"Writes to the new block"Future writes into the new blocks will not trigger copy-on-writeC1RootRootA FDB C1 2ModifyC’Modify1’15File System Consistency!Create a snapshot"Create a consistency point or snapshot every 10 seconds"On a crash, revert the file system to this snapshot"Not visible by users!Many requests between consistency points"Consistency point i"Many writes"Consistency point i+1 (advanced atomically)"Many writes"…!Question"Any relationships with transactions?16Non-Volatile RAM!Non-Volatile RAM"Flash memory (slower)"Battery-backed DRAM (fast but battery lasts for only days)!Use an NVRAM to buffer writes"Buffer all write requests since the last consistency point"A clean shutdown empties NVRAM, creates one more snapshot, and turns off NVRAM"A crash recovery needs to recover data from NVRAM to the most recent snapshot and turn on the system!Use two logs"Buffer one while writing another!Issues"What is the main disadvantage of NVRAM?"How large should the NVRAM be?17Write Allocation!WAFL can write to any blocks on disk"File metadata (i-node file, block map file and i-node map file) is in the file system!WAFL can write blocks in any order"Rely on consistency points to enforce file consistency"NVRAM to buffer writes to implement ordering18Snapshot Data Structure!WAFL uses 32-bit entries in the block map file"32-bit for each 4KB disk block"32-bit entry = 0: the block is free!Bit 0 = 1:active file system references the block!Bit 1 = 1:the most recent snapshot references the block19Snapshot Creation!Problem"Many NFS requests may arrive while creating a snapshot"File cache may need replacements"Undesirable to suspend the NFS request stream!WAFL solution"Before a creation, mark dirty cache data “in-snapshot” and suspend NFS request stream"Defer all modifications to “in-snapshot” data"Modify cache data not marked “in-snapshot”"Do not flush cache data not marked “in-snapshot”20Algorithm!Steps"Allocate disk space


View Full Document

Princeton COS 318 - NSF, Snapshot, Dedup and Review

Documents in this Course
Overview

Overview

25 pages

Deadlocks

Deadlocks

25 pages

lectute 2

lectute 2

28 pages

Lecturel

Lecturel

24 pages

Real mode

Real mode

49 pages

Lecture 2

Lecture 2

54 pages

lecture 5

lecture 5

27 pages

Load more
Download NSF, Snapshot, Dedup and Review
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 NSF, Snapshot, Dedup and Review 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 NSF, Snapshot, Dedup and Review 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?