What is the main purpose of the Two-Phase Commit (2PC) protocol in distributed transactions?
Think about how distributed systems keep data consistent when multiple databases are involved.
The 2PC protocol coordinates all participants to either commit or abort a transaction together, ensuring atomicity and consistency across distributed databases.
Which two phases correctly describe the Two-Phase Commit protocol?
One phase asks participants if they are ready, the other finalizes the decision.
The Two-Phase Commit protocol consists of the Prepare phase, where participants vote to commit or abort, and the Commit phase, where the coordinator tells participants to finalize the transaction.
In a Two-Phase Commit protocol, what happens if the coordinator fails after sending the prepare message but before sending the commit or abort decision?
Consider what participants do when they don't receive the final decision after voting.
If the coordinator fails after the prepare phase, participants cannot decide to commit or abort and remain blocked, waiting for the coordinator's decision to avoid inconsistency.
Which statement correctly distinguishes the Three-Phase Commit (3PC) protocol from the Two-Phase Commit (2PC) protocol?
Think about how protocols handle failures and participant blocking.
3PC introduces a third phase to reduce the chance of participants being blocked if the coordinator fails, improving on 2PC's blocking problem.
During a distributed transaction using 2PC, a network partition occurs isolating some participants from the coordinator. What is the most likely outcome for the isolated participants?
Consider what participants do when they cannot communicate with the coordinator after voting.
Participants isolated by a network partition remain blocked in the prepared state, waiting for the coordinator's commit or abort decision to maintain consistency.