Skip to content
SEE Exam Prep

Question 4 of 15 · CIE-2 QB · Set 2 · 2 marks

Open in ChatGPT

What is the purpose of the two-phase commit protocol?


The purpose of two-phase commit is to make a transaction across several nodes commit or abort atomically.

  • Phase 1: the coordinator asks every participant to prepare, and each votes yes or no.
  • Phase 2: if all vote yes, every participant is told to commit; otherwise all abort.
  • Why needed: without it one node could commit while another rolls back.
  • Cost: participants hold locks between voting and the decision.
  • Weakness: it blocks if the coordinator fails after collecting the votes.