two-phase commit (2PC)
Coordinate prepare and commit decisions across transaction participants.
Use this when One transaction must commit or abort across multiple supporting resource managers.
without the term
“These two databases must agree whether the whole transaction commits. Explain what happens if the coordinator crashes.”
with the term · How do you ask a model for two-phase commit (2PC)?
Evaluate native 2PC support here. Test coordinator failure after prepare and document recovery of in-doubt transactions.
What is two-phase commit (2PC)?
In 2PC, participants first prepare, then resolve the coordinator’s commit or abort decision. A prepared participant has promised it can commit and may retain locks while the outcome is unknown.
Why does two-phase commit (2PC) matter when vibe coding?
An agent can treat two sequential API calls as an atomic distributed transaction.
How do you do two-phase commit (2PC)?
Verify native participant support and a durable coordinator. Check crash recovery with a prepared participant and confirm unresolved transactions are monitored and resolved.
What goes wrong with two-phase commit (2PC)?
A coordinator failure can leave participants blocked. Arbitrary HTTP services are not automatically 2PC participants.
Sources for this entry
- PostgreSQL: PREPARE TRANSACTION
Durable prepared transactions for external coordinators retain locks until resolved.
- Bernstein, Hadzilacos and Goodman: Distributed Recovery
Section 7.5 derives three-phase commit under failure assumptions and discusses blocking with partitions.
Sources checked . Source checks do not establish human editorial approval. How we check content.