Two phase commit is a way to ensure in a distributed system that
a common action of several nodes of the system will either
be executed by all nodes or by none (see atomicity of
transactions). In this protocol the initiator (or a
chosen coordinator) of the common action ask all participants if
they are sure to be able to execute the action (1st phase:
prepare). If all nodes answer positively, the initiator will
command all nodes to execute the action (2nd phase:
commit). If one node answers negatively or not at all, the
initiator will cancel the action at all nodes (2nd phase:
abort).
This protocol ensures the atomicity of the distributed action
but has the disadvantage to abort the whole action if only one of
the participating nodes becomes (temporarily) unavailable.