---
title: "Short note: Distributed commit"
subject: "Distributed System"
chapter: 8
key: "semester_7/distributed_system:distributed-commit-note"
source: https://www.bctengineer.com/q/semester_7/distributed_system/distributed-commit-note
site: BCT Engineering
---

# Short note: Distributed commit

Distributed System · Chapter 8: Transaction and Concurrency Control

- Asked in: 2070 Asar, 4 marks
- Video: [Two phase Commit Protocol | Transaction | Distributed Systems | Lec-61 | Bhanu Priya](https://www.youtube.com/watch?v=W-TadPbi--A) — Education 4u
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/distributed_system/distributed-commit-note
- Whole chapter: https://www.bctengineer.com/md/semester_7/distributed_system/chapter-8

## Question

Write a short note on distributed commit.

## Short answer

Distributed commit ensures all or none of the servers in a transaction perform the operation. A coordinator asks participants; one-phase commit cannot signal unilateral abort. Two-phase commit (2PC) collects votes then distributes the decision; it blocks if the coordinator fails after yes votes. Three-phase commit adds a pre-commit phase to be non-blocking; logs on stable storage enable recovery.

## Answer

**Distributed commit** (atomic commitment) is the problem of making all processes in a group perform an operation (commit) or none of them. It is the base of atomic distributed transactions, where a transaction updates data at several servers and must not end with some servers committed and some aborted.

A **coordinator** asks the participants if they can commit; the decision is commit only if every participant agrees.

- **One-phase commit**: the coordinator tells everyone to commit or abort. A participant cannot tell the coordinator that it has had to abort (e.g. because of a deadlock), so this is not enough.
- **Two-phase commit (2PC)**: phase 1 collects votes (canCommit?/Yes-No); phase 2 distributes the decision (doCommit/doAbort). It blocks if the coordinator fails after participants voted Yes.
- **Three-phase commit (3PC)**: adds a pre-commit phase so participants can decide among themselves after a coordinator crash; non-blocking, but more messages.

```text
Coordinator  Participants
  canCommit? ------>
        <------ Yes/No
  doCommit/Abort -->
        <---- haveCommitted
```
Logs on stable storage are used so crashed servers can complete the commitment after recovery.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is the aim of distributed commit?
   A. All processes commit or none does
   B. The coordinator alone commits
   C. Only the majority commits
   D. Servers commit in turn
   Answer: A. No outcome where some servers commit and others abort is allowed. (Key point: Goal)

2. When does 2PC block?
   A. When the coordinator fails after participants voted Yes
   B. When a participant votes No
   C. When all vote Yes
   D. When logs are used
   Answer: A. Participants in the uncertain state cannot decide alone and must wait. (Key point: 2PC blocking)

3. What does 3PC add over 2PC?
   A. A pre-commit phase, giving non-blocking behaviour at the cost of more messages
   B. Fewer messages
   C. Removal of voting
   D. A shadow page table
   Answer: A. Pre-commit allows participants to decide among themselves after a coordinator crash. (Key point: 3PC difference)

## Related in Distributed System

- [Threads, checkpoint, distributed commit](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Athreads-checkpoint-commit) — Distributed System, chapter 3
- [Distributed deadlock; two-phase commit](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Adistributed-deadlock-2pc) — Distributed System, chapter 8
- [Short note: Two-phase commit](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Atwo-phase-commit-note) — Distributed System, chapter 8, asked 2×
- [Short note: Three-phase commit](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Athree-phase-commit-note) — Distributed System, chapter 8
- [Cascading aborts; three-phase commit](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Acascading-aborts-3pc) — Distributed System, chapter 8
- [Cascading aborts; atomic commit protocol](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Acascading-aborts-acp) — Distributed System, chapter 8
