Using Timestamping to Optimize Two Phase Commit

  • David Lomet

Published by Institute of Electrical and Electronics Engineers, Inc.

The two-phase commit (2PC) protocol is used to guarantee the serializability of distributed transactions. The message cost of the standard 2PC has led to efforts to optimize the protocol and reduce the number of messages required. The common optimizations require that each cohort of a transaction be terminated (finished with normal accessing of data) in order for these optimizations to lead to serial schedules. This paper suggests using timestamps as a substitute for knowing when cohorts are terminated, and shows how the 2PC protocol itself can be used to choose the timestamps. The key to this is to permit cohorts to vote transaction time ranges within which the transaction must commit or else be aborted. Using time ranges, the read only optimization and early release of read locks can be supported. The transaction times chosen are appropriate for identifying versions of data in a multiversion rollback database.