AFS Vice (Server), Venus (Client) Prototype Stub directories represents portions of the Vice name space located on other servers If file not on that server, search stub to find which server Named file by full pathname no inode Replication read-only replicate for topmost levels Cache Venus ask server for timestamp on open Performance many stat -> bad performance limit to ~20 users one process per client Hard to move file between servers Benchmark Many TestAuth (cache validation) GetFileStat () call CPU Bottleneck Context switch path traversing Unbalanced server load Revise Cache Management Cache dir contents & symbolic links status cache in memory (for stat) data cache in disk Modify directory directly on server Consistency Old: Client ask Server if changed New: Client cache, server promise to notify if change Name Resolution reintroduce two-level name (fid, pathname) Client covert pathname to fid fid: (volume number, vnode number, uniquifier) Low-Level Storage Representation Server: use talbe[vnode number] = inode number (Use vnode number as the index) Overview When client open a file go through each path component put to cache and setup callback (if not existed) Client select server by checking volume number in mapping cache if not in cache, contact any server Semantic Writes to file are immediately visible to process on the same machine but not in the network Flush file change on close other file operation are visible immediately everywhere multiple workstations can perform operation concurrently but need programs to cooperate (if cared) Disadvantages no concurrent read/write across clients no diskless operation building a distributed database is hard latency Coda Availability Volume storage group (VSG) Disconnected operation Scalability Callback-based cache coherence Whole-file caching Place functionality on clients Avoid system-wide rapid change First & Second Class Replication First Class Servers persistent, secure, complete… Second Class Clients Optimistic Vs Pessimistic Pessimistic Client acquire exclusive control Block r/w on others Client acquire shared control allow reading at other replicas Optimistic (Coda use this) Read/write everywhere Deal with conflict later Implementation States Hoarding (Normal) Hoard database + file usage history Hierarchical cache management - parent cannot be remove before child Emulation (Disconnected) Reintegration (Resume connection) Hoarding Hoard Walking Run every 10 min Update name binding (check new file for + entries, which indicate future children need high priority) Restore equilibrium by fetch and evict cache On callback break Files and symbolic link purge the object update on demand or during next hoard walk Directory mark cache as suspicious Emulation modified object has infinite priority Log all changes to log file optimization: multiple write into store Store meta data to recoverable virtual memory (RVM) Replay Algorithm parse log, lock all related files validation and execute (only execute meta data update for store) data transfer for store commit and release locks Conflict during phase 2 of replay, check if storeid if the same if server has new storeid - abort Questions AFS Initial Prototype....