Questions: Two-Phase Commit Protocol

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

In a two-phase commit protocol, participant P has voted 'yes' in the prepare phase. Before P receives the coordinator's commit or abort decision, the coordinator crashes. What must P do?

AImmediately abort the transaction to release its locks and become available again
BImmediately commit the transaction, since it already voted yes and promised it could commit
CBlock indefinitely — hold its locks and wait for the coordinator to recover before taking any action
DContact other participants to take a vote on whether to commit or abort
Question 2 Multiple Choice

The coordinator in a two-phase commit logs the commit decision and begins sending commit messages. It successfully notifies two of three participants before crashing. When the coordinator recovers, what does it do?

ARestart the entire transaction from the prepare phase because the commit was not fully delivered
BSend abort messages to all participants to ensure a clean state
CRe-send commit messages to complete the delivery, since the logged commit decision is authoritative
DAsk participants to vote again to determine the correct outcome
Question 3 True / False

Two-phase commit guarantees that a distributed transaction will complete within a bounded time, even if the coordinator crashes partway through.

TTrue
FFalse
Question 4 True / False

A participant that votes 'yes' in the prepare phase of 2PC is not permitted to unilaterally abort the transaction, even if it has been waiting for the coordinator's decision for an extended period.

TTrue
FFalse
Question 5 Short Answer

Explain the fundamental tradeoff that 2PC makes between atomicity and availability. What specific failure scenario exposes this tradeoff, and why can't the remaining participants resolve it on their own?

Think about your answer, then reveal below.