









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Transaction Processingfor E-Commerce
Assumptions
-^ Each resource manager independently commits oraborts a transaction atomically on its resources. •^ Home(T) decides when to start committing T •^ Home(T) doesn’t start committing T until Tterminates at all nodes (possibly hard) •^ Resource managers fail by stopping^ –^ no Byzantine failures, where a failed process exhibitsarbitrary behavior, such as sending the wrong message
-^ Transaction T accessed data at resource managersR, … R.^1 n •^ The goal is to either^ –^ commit T at all of R
, … R, or 1 n
-^ abort T at all of R
, … R 1 n
-^ even if resource managers, nodes and communicationslinks fail during the commit or abort activity • That is, never commit at R
but abort at Ri
.k Docsity.com
1 (Begin Phase 1) The coordinator sends a^ Request-to-Prepare
message to each participant 2 The coordinator waits for all participants to vote3 Each participant^ ^ votes^ Prepared
if it’s ready to commit ^ may vote^
No^ for any reason ^ may delay voting indefinitely 4 (Begin Phase 2) If coordinator receives
Prepared
from all participants, it decides to commit. (The transaction is now committed.)Otherwise, it decides to abort.
The Protocol (cont’d) 5 The coordinator sends its decision to allparticipants (i.e.
Commit^ or
Abort) 6 Participants acknowledge receipt of
Commit^ or
Abort^ by replying
Done.
Case 2: Abort Coordinator
Request-to-PrepareNo AbortDone
Participant
Performance
-^ In the absence of failures, 2PC requires 3rounds of messages before the decision ismade^ –^ Request-to-prepare^ –^ Votes^ –^ Decision •^ Done messages are just for bookkeeping^ –^ they don’t affect response time^ –^ they can be batched
Uncertainty (cont’d)
-^ The coordinator is never uncertain •^ If a participant fails or is disconnected fromthe coordinator while it’s uncertain,at recovery it must find out the decision
The Bad News Theorems • Uncertainty periods are unavoidable • Blocking - a participant must await a repair before continuing. Blocking is bad. • Theorem 1 - For every possible commit protocol(not just 2PC), a communications failure can causea participant to become blocked. • Independent recovery - a recovered participant can decide to commit or abort without communicatingwith other nodes • Theorem 2 - No commit protocol can guaranteeindependent recovery of failed participants