synchronization. physical clocks solar physical clocks cesium clocks international atomic time...

Download Synchronization. Physical Clocks Solar Physical Clocks Cesium Clocks International Atomic Time Universal Coordinate Time (UTC) Clock Synchronization Algorithms

Post on 20-Dec-2015




3 download

Embed Size (px)


  • Slide 1
  • Synchronization
  • Slide 2
  • Physical Clocks Solar Physical Clocks Cesium Clocks International Atomic Time Universal Coordinate Time (UTC) Clock Synchronization Algorithms One machine is connected to WWV No machine is receiving WWV time
  • Slide 3
  • Election Algorithms Many distributed systems require one process to act as coordinator Assume: All processes are the same Each process has a process number Each process knows the process number of every other process
  • Slide 4
  • The Bully Algorithm When a process P notices the coordinator is no longer responding it initiates and election P sends ELECTION to every process with a higher number If no one responds P wins and becomes coordinator If one of the higher-numbered processes responds then it takes over and P is done
  • Slide 5
  • The bully algorithm
  • Slide 6
  • Ring Algorithm The process noticing that the coordinator is not functioning builds an ELECTION message containing its process number and sends it its successor When the message gets back to the process that started it, its type is changed to COORDINATOR and sent around the ring The process with the largest number is elected.
  • Slide 7
  • Ring Algorithm
  • Slide 8
  • Atomic Transactions A transaction is either committed completely or nothing is done (all-or- nothing) Sample tape based application
  • Slide 9
  • Atomic Transaction System consists of some number of independent processes Each process can fail at random Assume communication errors are handled by underlying software
  • Slide 10
  • Storage types Volatile RAM memory Disk storage Stable storage Implemented using two or more disks In case a failure, the second disk is used for recovery
  • Slide 11
  • Stable storage
  • Slide 12
  • Slide 13
  • Example Transaction
  • Slide 14
  • Properties of Transactions Serializability Concurrent transactions do not interfere with each other Atomicity To the outside world, the transaction happens indivisibly Permanence Once a transaction commits, the changes are permanent
  • Slide 15
  • Nested Transactions The transactions can be contain sub- transactions Either all sub-transactions should commit or abort Each sub-transaction is given a private copy of data
  • Slide 16
  • Implementation Private Workspace The copying is expensive Optimizations for read and write are available No copy if no write is going on Only copy the block list of files and update modified blocks
  • Slide 17
  • Private Workspace
  • Slide 18
  • Writeahead Log A list called an intension list or LOG is created with TransID, BlockNo, OldVal, NewVal fields After the log has been successfully written, the changes are made to the file In case of ABORT, the operation are reversed from last to first
  • Slide 19
  • Writeahead LOG
  • Slide 20
  • Two Phase Commit Send each subordinate a message A subordinate responds when it is ready to commit If all subordinates are ready then commit else abort
  • Slide 21
  • Two Phase Commit
  • Slide 22
  • Concurrency Control Locking A process can lock a file before a transaction Smaller piece of data can be lock for efficiency (Granularity of locking) Two phase locking (growing and shrinking) can be used to avoid deadlocks and cascaded aborts
  • Slide 23
  • Optimistic concurrency Control Perform any transaction without considering other processes When committing the transaction, check if the files have been changed or not It is DeadLock Free In case of failure the transaction should re- run
  • Slide 24
  • Time stamp Assign a time stamp to each transaction at the moment it begins On committing check the orders If orders true then commit Else abort
  • Slide 25
  • Time stamp
  • Slide 26
  • Questions?


View more >