Try
↑ ↓ move↵ openesc close

Interview prep / Two-phase commit

Junior · Two-phase commit · System design interview question

What happens if one participant votes no?

Sketch your own answer first, then compare it with the one below.

A strong answer

The coordinator decides abort and tells every participant. Those that voted yes roll back their prepared changes and release their locks. The participant that voted no can abort at once, since it never promised anything.

A no vote is cheap. The expensive failure is the missing vote or the missing decision, because silence cannot be told from a slow reply. The coordinator can abort on a missing vote, since nobody has committed yet.

Sources

Learn it by running it

The two-phase commit lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms