midterm revision session
TRANSCRIPT
Midterm Revision SessionCS 5414
● Midterm : Monday, in class, closed notes
● Be clear/concise○ Symbols used in class are better than words/handwaving
● Be careful about assumptions○ it’s easy to assume the solution○ Sentences like “it is obvious that” are dangerous
● Definitions, definitions, definitions
● Do the required reading! ○ (yes, even if its 42 pages … )
Introductory Material
● Can you prove impossibility of two general problems?
● Can you prove that:○ All k muddy children will say “yes” at round k○ If father says nothing/says individually to children,
there is no solution to the problem?
● What is common knowledge?
● Can you draw the Kripke structures?
System Model (Communication/Failure)
● Synchronous system● Asynchronous system
○ No upper bound on message delivery time/on relative process speed
● Properties that can be assumed of channels
Terminology
● Event epi(ith event of p) / Local History (total order) /
History
● Space time diagrams
● Happens-Before relationship○ If ep
k,epl ∈ hi and k<l, then ep
k→epl
○ If ei=send(m) and ej=receive(m) then ei→ej○ If e →e’ and e’→e’’ then e’→e’’
Terminology
● Run: total ordering of events in the history
● Consistent run: a run that respects →
● Cut: subset of the global history (prefix of each local history)○ Can also write it as (c1,c2,c3)
● Frontier: set of events at the prefix
Terminology
● Local state: pi. Result of applying the first ith events to
state of p
● Global state: n-tuple of local states
● To each cut (c1, c2, cn) corresponds a global state ( p1
c1, p2c2, p3
cn)
Terminology
● Consistent Cut
Can you detect consistent cuts on space time diagrams?
● Consistent global state: state for which the corresponding cut is consistent
Snapshot Protocol ● Why did we want a snapshot protocol?
● Example question: Why is not necessary to listen on pj?
● Without this protocol, what is the weakest channel delivery property for external monitor to have consistent state?
Reachability
● Lattice: every node represents a consistent state.
● Represents all possible orders (runs) for a particular computation
● What are the properties of s? Why do we care?○ a global state for
snapshot start○ f snapshot finishes○ then a → s → f
Lamport Clocks
● Clock Condition: ○ e →e’ => LC(e) < LC(e’)
● How can Lamport clocks implement FIFO
● How can Lamport clocks implement Causal delivery?
● No gap detection
Vector Clocks (you need to be very comfortable with this)
● Strong Clock Condition: ○ e →e’ <=> VC(e) < V(e’)
● Update Rules:● On send (pi) On receive (pi)
● Vector Ordering:
● Concurrency:
Vector Clocks (Consistency)
Causal Delivery
● Weak Gap Detection
● Strong Gap Detection
● Delivery Rule
● How would you prove that this guarantees causal del?● Could you derive a weaker condition assuming FIFO
channels?
Safety/Liveness/Non-stable properties
● You should know how to define safety/liveness
● How can I compute on the lattice:○ Possibly( )○ Definitely( )
● When can local states be garbage collected when building the lattice?
Atomic Commit
● Impossibility result on communication/ total failures
● No independent recovery possible
Two phase locking
● Why can coordinator always vote abort?
Two phase locking (Termination)
● Cooperative termination protocol
● If all processes are uncertain (ak voted yes) but coordinator is down, what happens?
● 2PC can block even for non-total failures and no communication failures
Three-Phase Locking
● (Non-blocking property) If any process is uncertain, no process (including coordinator) can have decided to commit => it is therefore always safe to abort.
Three-Phase Locking (Termination Protocol)
● Why must pi run termination protocol in Step 6? It knows that the decision is commit ...
Three-Phase Locking (Termination/Recovery Protocol)
● Why can p not simply commit if it recovers from a failure after pre-commit ?
● (TR1) Why don’t we need to wait for all processes to reply?
● Does the upset tracking need to be accurate? (ex: pn failed first, just after voting abort. All other processes p0 to pn-1 fail in sequence but vote commit. What happens if pn recovers first?
State Machine Replication
● Agreement: Every non-faulty state machine receives every command
● Order: Every non-faulty state machine processes the commands it receives in the same order
(Order Implementation/Logical Clocks/Replica-Generated Ids)
Primary Backup / Chain Replication
● What are the benefits of primary backup vs chain replication?○ For queries○ For updates
● What are hot/cold backups?
Rollback Recovery - Checkpointing
● What is the goal of rollback-recovery?
● Uncoordinated checkpointing○ Cheap but domino effect
● Coordinated checkpointing○ Always restart from most recent checkpoint but high
latency● Communication induced checkpointing
○ local/forced snapshots. Z-Paths
Rollback Recovery - Logging
● Piecewise deterministic assumption: all nondeterministic events can be identified
● Log determinants
● Orphan process: includes delivery event but send event has been lost
● Pessimistic Logging / Sender Based Logging / Optimistic Logging / Causal Logging
Rollback Recovery - Consistency
Rollback Recovery - Consistency
● What are the pros/cons of each scheme? (Check table in paper)
Reliable Broadcast● What happens if
the sender fails before sending any message?
● Is it ok for everyone to output m’ if the sender proposed m but is faulty?
Terminating Reliable Broadcast
● If one process delivers SF, what must the other processes do?
Terminating Reliable Broadcast
● If one process delivers SF, what must the other processes do?
Consensus
● What happens if a faulty process proposes a value v’?
● What happens if a process does not propose?
Consensus
● What happens if a faulty process proposes a value v’?
● What happens if a process does not propose?
Properties of send/receive
● Validity● Uniform integrity● Integrity (for arbitrary failures)