eecs 591
play

EECS 591 D ISTRIBUTED S YSTEMS Manos Kapritsos Fall 2020 Slides - PowerPoint PPT Presentation

EECS 591 D ISTRIBUTED S YSTEMS Manos Kapritsos Fall 2020 Slides by: Lorenzo Alvisi 3-P HASE C OMMIT Coordinator Participant I. sends VOTE-REQ to all participants 2. sends to Coordinator if = No then := Abort 3. if (all


  1. EECS 591 D ISTRIBUTED S YSTEMS Manos Kapritsos Fall 2020 Slides by: Lorenzo Alvisi

  2. 3-P HASE C OMMIT Coordinator Participant I. sends VOTE-REQ to all participants 2. sends to Coordinator if = No then := Abort 3. if (all votes are Yes ) then halt send Precommit to all else := Abort send Abort to all who voted Yes halt 4. if received Precommit then send Ack 5. collect Ack from all participants When all Ack ’s have been received: := Commit 6. When receives Commit , send Commit to all sets := Commit and halts

  3. T IMEOUT ACTIONS Coordinator Participant Step 2: is waiting for VOTE-REQ from the coordinator Step 3: Coordinator is waiting for vote from participants Same as in 2PC Same as in 2PC Step 4: is waiting for Precommit Run termination protocol Step 5: Coordinator is waiting for Ack ’s Step 6: is waiting for Commit Coordinator sends Commit Run termination protocol

  4. T IMEOUT ACTIONS Coordinator Participant Step 2: is waiting for VOTE-REQ from the coordinator Step 3: Coordinator is waiting for vote from participants Same as in 2PC Same as in 2PC Step 4: is waiting for Precommit Run termination protocol Step 5: Coordinator is waiting for Ack ’s Step 6: is waiting for Commit Coordinator sends Commit Participant knows what they will receive… but the NB property can be violated! Run termination protocol

  5. T ERMINATION PROTOCOL : P ROCESS STATES At any time while running 3PC, each participant can be in exactly one of these four states: Aborted Not voted, voted No , received Abort Uncertain Voted Yes but not received Precommit Committable Received Precommit , not Commit Committed Received Commit

  6. N OT ALL STATES ARE COMPATIBLE Aborted Uncertain Committable Committed Aborted Uncertain Committable Committed

  7. T ERMINATION PROTOCOL When times out, it starts an election protocol to elect a new coordinator The new coordinator sends STATE-REQ to all processes that participated in the election The new coordinator collects the states and follows a set of termination rules

  8. to elect a new coordinator The new coordinator sends STATE-REQ to all T ERMINATION PROTOCOL processes that participated in the election The new coordinator collects the states and follows a set of termination rules TR1: if some process decided Abort , then decide Abort send Abort to all halt TR2: if some process decided Commit , then decide Commit send Commit to all halt TR3: if all processes that reported state are uncertain, then decide Abort send Abort to all halt TR4: if some process is committable, but none committed, then send Precommit to uncertain processes wait for Ack ’s send Commit to all halt

  9. T ERMINATION PROTOCOL AND FAILURES Processes can fail while executing the termination protocol if times out on , it can just ignore if fails, a new coordinator is elected and the protocol is restarted (election protocol to follow) total failures will need special care

  10. R ECOVERING If fails before sending Yes , decide Abort If fails after having decided, follow decision If fails after voting Yes , but before receiving decision value asks other processes for help 3PC is non-blocking: will receive a response with the decision If has received Precommit still needs to ask other processes (cannot just Commit ) No need to log Precommit ! (or is there?)

  11. T HE ELECTION PROTOCOL Processes agree on linear ordering (e.g. by pid) Each process maintains a set of all processes that it believes to be operational When detects failure of , it removes from and chooses smallest in to be the new coordinator If , then is the new coordinator Otherwise, sends UR-ELECTED to

  12. T OTAL FAILURE Suppose that is the first process to recover and that is uncertain. Can decide Abort ? Some process could have decided Commit after crashed! is blocked until some process recovers such that either can recover independently is the last process to fail: then can simply invoke the termination protocol

  13. D ETERMINING THE LAST PROCESS TO FAIL Suppose a set of processes has recovered Does contain the last process to fail? the last process to fail is in the set of 
 every process so the last process to fail must be in contains the last process to fail if:

  14. A DMINISTRIVIA Enrollment finalized Homework #1 due next Monday 9/28 before class Research project Declare your team by Oct 1st (by email to me) Declare your topic by Oct 8 (by email to me) Not sure what to do? Come talk to me.

  15. C ONSENSUS AND R ELIABLE B ROADCAST

  16. B ROADCAST If a process sends a message , then every process eventually delivers How can we adapt the spec for an environment where processes may fail?

  17. R ELIABLE BROADCAST Validity If the sender is correct and broadcasts a message , then all correct processes eventually deliver Agreement If a correct process delivers a message , then all correct processes eventually deliver Integrity Every correct process delivers at most one message, and if it delivers , then some process must have broadcast

  18. T ERMINATING R ELIABLE BROADCAST Validity If the sender is correct and broadcasts a message , then all correct processes eventually deliver Agreement If a correct process delivers a message , then all correct processes eventually deliver Integrity Every correct process delivers at most one message, and if it delivers , then some process must have broadcast Termination Every correct process eventually delivers some message

  19. C ONSENSUS Every process has a value to propose. After running a consensus algorithm, all processes should deliver the same value.

  20. C ONSENSUS Validity If all processes that propose a value propose , then all correct processes eventually decide Agreement If a correct process decides , then all correct processes eventually decide Integrity Every correct process decides at most one value, and if it decides , then some process must have proposed Termination Every correct process eventually decides some value

Recommend


More recommend