A Flexible Two-Phase Commit Protocol

Abstract Even though the two-phase commit protocol is a well-known protocol terminating transactions (atomic actions) in a general distributed environment, nearly all descriptions of the protocol refer to special instances of communication, mostly to distributed databases, and therefore cover only a small range of the possible forms of the protocol. In this paper a flexible two-phase commit protocol for distributed transaction processing trees is presented that permits a free choice of the commit-coordinator and independently a free choice of one or more commit-initiators. The protocol is designed to allow each node of the tree to initiate termination of the transaction based on its own termination conditions and without regard for a hierarchy, but to maintain the essentials of a central site two-phase commit. Since the protocol permits a wide variety of different termination strategies, exceptional techniques such as “nested two-phase commit”, “last agent optimisation” and “inverted tree” can be regarded as specialisations of this protocol. Such techniques are under discussion within the international standardisation organisation ISO as extensions to the rather restrictive commit protocol currently used in the OSI transaction processing standardisation project.