A Case for Non-Two-Phase Locking Protocols that Ensure Atomicity

A transaction is atomic if it can be considered, as far as other transactions are concerned, to be indivisible and instantaneous even in the case of failure. An almost universally accepted way to ensure atomicity is to use a strict two-phase locking protocol with a roll-back scheme for recovery in case of deadlock or failure. In this note, we argue that this method is not the most economical way to achieve this end. We develop a Dependency Graph model which is used to analyze the two-phase and non-two-phase locking schemes. It is shown that one way of choosing between the two types of schemes is to estimate the number of rollbacks required. If this number is large, a two-phase scheme is preferable; if small, a non-two-phase scheme should be selected. We demonstrate that with reasonable discipline, the number of such rollbacks can be minimized. Thus, contrary to common practice and belief, non-two-phase protocols can be effectively used in guaranteeing atomicity.

[1]  Daniel J. Rosenkrantz,et al.  System level concurrency control for distributed database systems , 1978, TODS.

[2]  Mihalis Yannakakis,et al.  Locking policies: Safety and freedom from deadlock , 1979, 20th Annual Symposium on Foundations of Computer Science (sfcs 1979).

[3]  Joel F. Bartlett,et al.  A NonStop kernel , 1981, SOSP.

[4]  Abraham Silberschatz,et al.  A Family of Locking Protocols for Database Systems that Are Modeled by Directed Graphs , 1982, IEEE Transactions on Software Engineering.

[5]  Abraham Silberschatz,et al.  Consistency in Hierarchical Database Systems , 1980, JACM.

[6]  C. Mohan,et al.  An Efficient Deadlock Removal Scheme for Non-Two-Phase Locking Protocols , 1982, VLDB.

[7]  Irving L. Traiger,et al.  Granularity of Locks and Degrees of Consistency in a Shared Data Base , 1998, IFIP Working Conference on Modelling in Data Base Management Systems.

[8]  Arie Shoshani,et al.  System Deadlocks , 1971, CSUR.

[9]  Butler W. Lampson,et al.  Crash Recovery in a Distributed Data Storage System , 1981 .

[10]  Abraham Silberschatz,et al.  Deadlock removal using partial rollback in database systems , 1981, SIGMOD '81.

[11]  Daniel J. Rosenkrantz,et al.  Concurrency control for database systems , 1976, 17th Annual Symposium on Foundations of Computer Science (sfcs 1976).

[12]  Irving L. Traiger,et al.  The notions of consistency and predicate locks in a database system , 1976, CACM.

[13]  Abraham Silberschatz,et al.  Controlling concurrency using locking protocols , 1979, 20th Annual Symposium on Foundations of Computer Science (sfcs 1979).

[14]  Abraham Silberschatz,et al.  Non-Two-Phase Locking Protocols with Shared and Exclusive Locks , 1980, VLDB.

[15]  Abraham Silberschatz,et al.  Locking Protocols: From Exclusive to Shared Locks , 1983, JACM.