skip to main content
article
Free access

Altruistic locking

Published: 01 March 1994 Publication History

Abstract

Long-lived transactions (LLTs) hold on to database resources for relatively long periods of time, significantly delaying the completion of shorter and more common transactions. To alleviate this problem we propose an extension to two-phase locking, called altruistic locking, whereby LLTs can release their locks early. Transactions that access this released data are said to run in the wake of the LLT and must follow special locking rules. Like two-phase locking, altruistic locking is easy to implement and guarantees serializability.

References

[1]
AGRAWAL, D., AND EL ABBADI, A. 1990. Constrained shared locks for increasing concurrency in databases. In Proceedzngs of the 9th ACM Symposzum on Principles of Database Systems. ACM, New York. The full version is TRCS 90-14, Dept. of Computer Science, Univ. of California, Santa Barbara, Calif., 1990.
[2]
AGRAWAL, R., CAREY, M. J., AND LIVNY, M 1987. Concurrency control performance modeling: Alternatives and implications. ACM Trans. Database Syst. 12, 4 (Dec.), 609 654.
[3]
AGRAWAL, D., EL ABBADI, A., AND LANG, A.E. 1991. Performance characteristics of protocols with ordered shared locks. In Proceedings of the Internattonal Conference on Data Engtneering (Kobe, Japan), 592-601.
[4]
AHUJA, M. L., AND BROWNE, J. C. 1987. Concurrency control by pre-ordering entit~es in databases with multi-versioned entities. In Proceedings of the International Conference on Data Englneerzng (Los Angeles, Feb.), 312-321.
[5]
BADRINATH, B. R, AND RAMAMRITHA2X4, K. 1992 Semantics-based concurrency control: Beyond commutativity. ACM Trans. Database Svst. 17, I (Mar.), 163 199
[6]
BAYER, R. 1987. Consistency of transactions and random batch. ACM Trans. Database Syst 12, i (Jan).
[7]
BEER1, C., BERNSTEIN, P. A., AND GOODMAN, N. 1989. A model for concurrency in nested transactions systems. J. ACM 36, 2 (Apr), 230 269.
[8]
BERSTEIN, P. A., HADZILACOS, V., AND GOODMAN, N. 1987 Concurrency Control and Recovery in Database SYsterr~.~. Addison-Wesley, Reading, Maaa.
[9]
BREITBART, Y. GEORGAKOPOULOS, D., RUSINKIEWICZ, M., AND SILBERSCHATZ, A. 1991. On rigorous transaction scheduling. IEEE Trans Softw. Eng. 17, 9 (Sept.), 954 960
[10]
CAREY, M. J., AND MUHANNA, W.A. 1986. The performance of multivers~on concurrency control algorithms. ACM Trans Comput. Syst 4, 4 (Nov.), 338 378.
[11]
CHAN, A., FOX, S., L~N, W. K., Nora, A., AND Rms, D.R. 1982. The implementation of an integrated concurrency control and recovery scheme. In Proceedzngs ACM SIGMOD International Conference on Management of Data. ACM, New York, 184 191.
[12]
ESWARAN, K. P., GRAY, J. N., Lo~m, R. A., AND TRAIG~,'R, I.L. 1976. The notions of consistency and predicate locks in a database system. Cornmun. ACM 19, 11 (Nov.), 624 633.
[13]
FARRAG, A. A., AND (~ZSU, M.T. 1983. Using semantic knowledge of transactions to increase concurrency. ACM Trans. Database Syst. 14, 4 (Dec.), 503-525.
[14]
GARCIA-MOLINA, H. 1983. Using semantic knowledge for transaction processing in a distributed database. ACM Trans. Database Syst. 8, 2 (June), 186-213.
[15]
GARCIA-MOLINA, H., AND SALEM, K. 1987. Sagas. In Proceedings ofACM SIGAMOD Annual Conference. ACM, New York, 249-259.
[16]
GtFFORD, D. K., AND DONAHUE, J. E. 1982. Coordinating independent atomic actions. In Proceedings of IEEE COMPCON. IEEE,New York.
[17]
GRAY, J. 1981. The transaction concept: Virtues and limitations. In Proceedings of the International Conference on Very Large Databases (Cannes, France, Sept.). VLDB Endowment, 144 154.
[18]
HADZmACOS, V. 1988. A theory of reliability in database systems. J. ACM 35, I (Jan.), 121-145.
[19]
KEDEM, Z., AND SILVERSCHATZ, A. 1980. Non-two-phase locking protocols with shared and exclusive locks. In Proceedings of the Internatwnal Conference on Very Large Databases (Montreal, Canada, Oct.), VLDB Endowment, 309-317.
[20]
LAW, A. M., AND KELTON, W.D. 1982. Simulation Modehng and Analysis. McGraw-Hill, New York.
[21]
RAZ, Y. 1992. The principle of commitment ordering. Tech. Rep. DEC-TR 841, Digital Equipment Corporation.
[22]
REED, D.P. 1983. Implementing atomic actions on decentralized data. ACM Trans. Comput. Syst. 1, i (Feb.), 3 23.
[23]
SALEM, K. M., GARCIA-MOLINA, H., AND ALONSO, R. 1987. Altruistic locking: A strategy for coping with long-lived transactions. In Lecture Notes in Computer Science, vol. 359. Springer-Verlag, New York, 175-199.
[24]
SCHWETMAN, H. 1990. CSIM reference manual (revision 14). MCC Tech. Rep. ACT-ST-252-87, Microelectronics and Computer Technology Corporation, Austin, Tex.

Cited By

View all

Recommendations

Reviews

Robert J. Tufts

Long-lived transactions (LLTs) have historically caused processing problems for large, transaction-driven database systems. Such transactions tend to lock a large number of database objects for a long period of time, causing delays in other transactions. In order to handle LLTs, some operational systems defer their processing to off hours, especially if they update a large number of database objects. Salem, Garcia-Molina, and Shands approach the problem in a different way. Instead of treating database objects as owned by specific transactions (the standard approach of two-phase locking), the authors propose to treat LLTs as leaving a wake of locked records behind them as they progress through the database. Other transactions, if they run in the wake of an LLT, can unlock and use database objects that are no longer needed. The authors' extension to the traditional two-phase locking protocols would include rules allowing LLTs to “donate” unneeded records when through with them (hence the term “altruistic locking” ). This would permit other transactions to access and unlock the donated records and complete their processing without having to wait for the LLT to complete. In order to guarantee recovery, the LLT would not be able to donate records that it has added or changed until a database commit occurred. Likewise, the transaction running in the wake of another must not access records outside of that wake until the LLT performs its first unlock operation. The stated purpose of the paper is to propose an extension to the standard two-phase database locking protocol that would allow the running of short transactions in the wake of LLTs. The extensive discussion clearly explains how this can be done, exploring all aspects of blocking and queueing, waiting for objects to be unlocked, recovery processing, and extensions to the basic altruistic locking rules. The theoretical ideas are backed up with simulated results showing substantially better performance when altruistic locking is implemented. The best feature of the paper is its readability. By using standard database terminology and explaining all new terms before using them, the authors have ensured that the reader is easily able to move through the paper with a minimum of confusion. In some respects, though, the 50-page discussion seems a bit long to cover the subject. Perhaps the paper's worst feature is the authors' misunderstanding of the purpose of savepoints. The authors contend that altruistic locking greatly improves performance as long as LLTs use infrequent write locks for update purposes. The dismissal of savepoints as a solution to this problem because they do not guarantee failure atomicity at the transaction level shows a misunderstanding of how savepoints should operate. Savepoints are defined as logical points in a transaction's update operation where processing can be rolled back to and restarted in case of an abort. In effect, savepoints preclude the need for failure atomicity at the transaction level because they provide it at the transaction processing sublevel. When a transaction reaches a savepoint, commits are initiated for all locked records up to that point in processing, and then transaction processing continues. Savepoints have been successfully implemented for LLTs for over two decades (since IBM IMS DL/1 in 1973), and their proper implementation would allow altruistic locking to be used for long update transactions. Overall, the paper is well written and thought-provoking for general students of database technology. It is also a good source of ideas for vendors of database management systems who want to improve their products. The bibliography includes a good mix of theoretical and practical references for background information. In short, I would recommend the paper to anyone with an interest in transaction-based processing systems.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Database Systems
ACM Transactions on Database Systems  Volume 19, Issue 1
March 1994
163 pages
ISSN:0362-5915
EISSN:1557-4644
DOI:10.1145/174638
  • Editor:
  • Won Kim
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 March 1994
Published in TODS Volume 19, Issue 1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. atomicity
  2. locking
  3. scheduling
  4. serializability

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)75
  • Downloads (Last 6 weeks)24
Reflects downloads up to 14 Sep 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media