FINAL EXAM IS THURSDAY 7 MAY IN THIS ROOM 10:00am -- 11:50am Delayed write on close Combines the advantages and dissadvantages of delayed write and write on close. Doing it "right" Multiprocessor caching (of central memory) is well studied and many solns are known. We mentioned this at beginning of course Cache consistency (aka cache coherence) Book mentions a centralized soln. Others are possible, but none are cheap Interesting thought: IPC is more expensive that a cache invalidate but disk I/O is much rarer than mem refs. Might this balance out and might one of the cache consistence algorithms perform OK to manage distributed disk caches? If so why not used? Perhaps NSF is good enough and not enough reason to change (NFS predates cache coherence work). Replication Some issues similar to (client) caching Why? Because WHENEVER you have multiple copies of anything, bells ring Are they immutable? What is update policy? How do you keep copies consistent? Purposes of replication Reliability A "backup" is available if data is corrupted on one server. Availability Only need to reach ANY of the servers to access the file (at least for queries) NOT the same as reliability Performance Each server handles less than the full load (for a query-only system MUCH less) Can use closest server lowering network delays NOT important for dist sys on one physical network VERY important for the web mirror sites Transparancy If can't tell files are replicated, say the system has replication transparency Creation can be completely opaque i.e. fully manual users use copy commands if directory supports multiple binary names for a single symbolic name, use this when making copies presumably subsequent opens will try the binary names in order (so not opaque) Creation can use lazy replication User creates original system later makes copies subsequent opens can be (re)directed at any copy Creation can use group communication User directs requests at a group Hence creation happen to all copies in the group at once HOMEWORK 13-14 Update protocols Primary copy All updates done to the primary copy This server writes the update to stable storage and then updates all the other (secondary) copies. After a crash, the server looks at stable storage and sees if there are any updates to complete. Reads are done from any copy. This is good for reads (read any one copy). Writes are not so good. Can't write if primary copy is unavailable Semantics The update can take a long time (some of the secondaries can be down) While the update is in progress, reads are concurrent with it. That is might get old or new value depending which copy they read. Voting All copies are equal (symmetric) To write you must write at least WQ of the copies (a write quorum). Set the version number of all these copies to 1 + max of current version numbers. To read you must read at least RQ copies and use the value with the highest version. Require WQ+RQ > num copies Hence any write quorum and read quorum intersect. Hence the highest version number in any read quorum is the highest ver num there is. Hence always read the current version Consider extremes (WQ=1 and RQ=1) Fine points (omitted by tannenbaum) To write, you must first read all the copies in your WQ to get the ver num. Must prevent races Let N=2, WQ=2, RQ=1. Both copies (A and B) have ver num 10 Two updates start. U1 wants to write 1234, U2 wants to write 6789. Both read ver numbers and add 1 (get 11). U1 writes A and U2 writes B at roughly the same time. Later U1 writes B and U2 writes A. Now both are at version 11 but A=6789 and B=1234 HOMEWORK 13-15 Voting with ghosts Often reads dominate writes so choose RQ=1 (or at least RQ very small so WQ very large) This makes it hard to write. E.g. RQ=1 so WQ=n and hence can't update if any machine is down. When one detects that a server is down, a ghost is created. Ghost canNOT participate in read quorum, but can in write quorum write quorum must have at least one non-ghost Ghost throws away value written to it Ghost always have version 0 (tannenbaum forgot this point) When crashed server reboots, it accesses a read quorum to update its value