Two-phase commit
Doug Woos
Two-phase commit Doug Woos Logistics notes Problem Set 2 out - - - PowerPoint PPT Presentation
Two-phase commit Doug Woos Logistics notes Problem Set 2 out - Due next Friday Next week: Paxos - Notoriously difficult topic - Please do the reading! Caching Discussion Complexity as a downside Do the scalability/performance issues
Doug Woos
Problem Set 2 out
Next week: Paxos
“Complexity” as a downside Do the scalability/performance issues mentioned in the paper exist today? Why do we use NFS? When is the recovery protocol executed?
Sharding
Another axis of scaling, cf. replication
Adve rule we discussed lets us avoid synchronizing between shards for simple reads and writes But what if we do need to synchronize across shards? Transactions: atomic updates to multiple items
I have three advisors (Tom, Zach, Mike) Want to schedule a meeting with all of them
Calendars all live on different nodes! Other students also trying to schedule meetings Nodes can fail, messages can be dropped (of course)
Tom Mike Zach Doug
Tom Mike Zach Doug Meet at 11 on Tues
Tom Mike Zach Doug OK
Tom Mike Zach Doug Meeting Doug @ 11 on Tues
Tom Mike Zach Doug Meet at 11 on Tues Meeting Doug @ 11 on Tues
Tom Mike Zach Doug OK Meeting Doug @ 11 on Tues
Tom Mike Zach Doug Meeting Doug @ 11 on Tues Meeting Doug @ 11 on Tues
Tom Mike Zach Doug Meet at 11 on Tues Meeting Doug @ 11 on Tues Meeting Doug @ 11 on Tues
Tom Mike Zach Doug Busy! Meeting Doug @ 11 on Tues Meeting Doug @ 11 on Tues
Tom Mike Zach Doug Meeting Doug @ 11 on Tues Meeting Doug @ 11 on Tues
Tom Mike Zach Doug Meeting Doug @ 11 on Tues Meeting Doug @ 11 on Tues
Tom Mike Zach Doug
Tom Mike Zach Doug Meet at 11 on Tues
Tom Mike Zach Doug OK
Tom Mike Zach Doug Maybe Meeting Doug @ 11 on Tues
Tom Mike Zach Doug Maybe Meeting Doug @ 11 on Tues Meet at 11 on Tues
Tom Mike Zach Doug Maybe Meeting Doug @ 11 on Tues OK
Tom Mike Zach Doug Maybe Meeting Doug @ 11 on Tues Maybe Meeting Doug @ 11 on Tues
Tom Mike Zach Doug Maybe Meeting Doug @ 11 on Tues Maybe Meeting Doug @ 11 on Tues Meet at 11 on Tues
Tom Mike Zach Doug Maybe Meeting Doug @ 11 on Tues Maybe Meeting Doug @ 11 on Tues Busy!
Tom Mike Zach Doug Maybe Meeting Doug @ 11 on Tues Maybe Meeting Doug @ 11 on Tues
Tom Mike Zach Doug Maybe Meeting Doug @ 11 on Tues Maybe Meeting Doug @ 11 on Tues Never mind!
Tom Mike Zach Doug Maybe Meeting Doug @ 11 on Tues
Tom Mike Zach Doug Maybe Meeting Doug @ 11 on Tues Never mind!
Tom Mike Zach Doug
Atomic commit protocol (ACP)
transaction is committed
transaction is eventually either committed or aborted
Roles:
update data relevant to the transaction
the protocol (might also be a participant) RPCs:
In the absence of failures, 2PC is pretty simple! When can interesting failures happen?
Coordinator Participant Participant Prepare Prepare Yes No Abort Abort Decision?
Coordinator Participant Participant Prepare Prepare Yes Yes Commit Commit Yes
Coordinator Participant Participant Prepare Prepare Yes Yes No Abort Abort Decision?
Coordinator Participant Participant Prepare Prepare Yes Yes Yes Commit Commit
Coordinator Participant Participant Prepare Prepare Yes Yes Yes Commit Commit Prepare Prepare
Coordinator Participant Participant Prepare Prepare Yes Yes Yes Commit Commit Prepare Prepare Yes Yes
Coordinator Participant Participant Prepare Prepare Yes Commit Yes Yes Commit Decision?
Coordinator Participant Participant Prepare Prepare Yes Commit Commit Yes Yes Decision?
Coordinator Participant Participant Prepare Prepare Yes
No? Commit? Decision? Yes Yes
Is 2PC a state machine replication protocol?
Is 2PC a state machine replication protocol?
2PC is for coordinating an operation between multiple nodes, where every node has to agree in order for the system to make progress!
State machine State machine State machine 2PC 2PC 2PC
State machine State machine State machine 2PC 2PC 2PC
Does 2PC solve Two Generals? Why not?