skip to main content
article
Free Access

Deadlock detection in distributed databases

Published:01 December 1987Publication History
Skip Abstract Section

Abstract

The problem of deadlock detection in distributed systems has undergone extensive study. An important application relates to distributed database systems. A uniform model in which published algorithms can be cast is given, and the fundamental principles on which distributed deadlock detection schemes are based are presented. These principles represent mechanisms for developing distributed algorithms in general and deadlock detection schemes in particular. In addition, a hierarchy of deadlock models is presented; each model is characterized by the restrictions that are imposed upon the form resource requests can assume. The hierarchy includes the well-known models of resource and communication deadlock. Algorithms are classified according to both the underlying principles and the generality of resource requests they permit. A number of algorithms are discussed in detail, and their complexity in terms of the number of messages employed is compared. The point is made that correctness proofs for such algorithms using operational arguments are cumbersome and error prone and, therefore, that only completely formal proofs are sufficient for demonstrating correctness.

References

  1. AWERBUCH, B., AND MICALI, S. 1986. Dynamic deadlock resolution protocols, in Proceedings of the Foundations of Computer Science (Toronto, Canada). IEEE, New York, pp. 196-207.Google ScholarGoogle Scholar
  2. BERNSTEIN, P. A., HADZILACOS, V., AND GOODMAN, N. 1987. Concurrency Control and Recovery in Database Systems. Addison Wesley, Reading, Mass. Google ScholarGoogle Scholar
  3. BRACHA, G., AND TOUEG, S. 1983. A distributed algorithm for generalized deadlock detection. Tech. Rep. TR 83-558, Cornell Univ., Ithaca, N.Y.Google ScholarGoogle Scholar
  4. BRACHA, G., AND TOUEG, $. 1984. A distributed algorithm for generalized deadlock detection. In Proceedings of the A CM Symposium on Principles of Distributed Computing (Vancouver, Canada, Aug.). ACM, New York, pp. 285-301. Google ScholarGoogle Scholar
  5. CHANDY, K. M., AND LAMPORT, L. 1985. Distributed snapshots: Determining global states of distributed systems. A CM Trans. Program. Lang. Syst. 3, i (Feb.), 63-75. Google ScholarGoogle Scholar
  6. CHANDY, K. M., AND MISRA, J. 1982. A distributed algorithm for detecting resource deadlocks in distributed systems. In Proceedings of the A CM Symposium on Principles of Distributed Computing (Ottawa, Canada, Aug.). ACM, New York, pp. 157-164. Google ScholarGoogle Scholar
  7. CHANDY, K. M., AND MISRA, J. 1986. An example of stepwise refinement of distributed programs: Quiescence detection. A CM Trans. Program. Lang. Syst. 8, 3 (July), 326-343. Google ScholarGoogle Scholar
  8. CHANDY, K. M., MISRA, J., AND HAAS, L. M. 1983. Distributed deadlock detection. A CM Trans. Comput. Syst. 1, 2 (May), 144-156. Google ScholarGoogle Scholar
  9. CHANG, E. 1982. Echo algorithms: Depth parallel operations on general graphs. IEEE Trans. Softw. Eng. SE-8, 4 (July), 391-401.Google ScholarGoogle Scholar
  10. DIJKSTRA, E. W., AND SCHOLTEN, C. S. 1980. Termination detection for diffusing computations. In{. Process. Lett. 11, I (Aug.).Google ScholarGoogle Scholar
  11. DIJKSTRA, E. W., FEIJEN, W., AND VAN GASTEREN, A. J. M. 1983. Derivation of a termination detection algorithm for distributed computations. Inf. Process. Lett. 16, 5 (June), 217-219.Google ScholarGoogle Scholar
  12. ELMAGARMID, A. K. 1985. Deadlock detection and resolution in distributed processing systems. Ph.D. dissertation, Dept. of Electrical Engineering, Ohio State Univ., Columbus, Ohio. Google ScholarGoogle Scholar
  13. ELMAGARMID, A. K. 1986. A survey of distributed deadlock detection algorithms. A CM SIGMOD Rec. 15, 3 (Sept.). Google ScholarGoogle Scholar
  14. GAFNI, E. 1986. Perspectives on distributed network protocols: A case for building blocks. In IEEE Military Communications Conference (Monterey, Calif.). IEEE, New York, pp. 1.1.1-1.1.5.Google ScholarGoogle Scholar
  15. GIFFORO, D. G. 1979. Weighted voting for replicated data. In Proceedings of the 7th ACM Symposium on Operating Systems Principles (Pacific Grove, Calif., Dec.). ACM, New York, pp. 150-163. Google ScholarGoogle Scholar
  16. GLIGOR, V., AND SHATTUCK, S. 1980. On deadlock detection in distributed databases. IEEE Trans. Softw. Eng. SE-6, 5 (Sept.).Google ScholarGoogle Scholar
  17. GRAY, J. N., HOMAN, P., KORTH, H. F., AND OBER- MARCK, R. L. 1981. A straw man analysis of the probability of waiting and deadlock in a database system. Tech. Rep. RJ 3066, IBM Research Laboratory, San Jose, Calif.Google ScholarGoogle Scholar
  18. HAAS, L. M. 1981. Two approaches to deadlock detection in distributed systems. Ph.D. dissertation, Dept. of Computer Sciences, Univ. of Texas, Austin, Tex. Google ScholarGoogle Scholar
  19. HAAS, L. M., AND MOHAN, C. 1983. A distributed deadlock detection algorithm for a resource-based system. Res. Rep. RJ 3765, IBM Research Laboratory, San Jose, Calif.Google ScholarGoogle Scholar
  20. H~LARY, J., JARD, C., PLOUZEAU, N., AND RAYNAL, M. 1987. Detection of stable properties in distributed applications. In Proceedings of the A CM Symposium on Principles of Distributed Computing (Vancouver, Canada, Aug.). ACM, New York, pp. 125-136. Google ScholarGoogle Scholar
  21. HERMANN, T., AND CHANDY, K. M. 1983. A distributed procedure to detect AND/OR deadlock. Tech. Rep. TR LCS-8301, Dept. of Computer Sciences, Univ. of Texas, Austin, Tex.Google ScholarGoogle Scholar
  22. HO, G. S., AND RAMAMOORTHY, C. V. 1982. Protocols for deadlock detection in distributed database systems. IEEE Trans. So{tw. Eng. SE- 8, 6 (Nov.), 554-557.Google ScholarGoogle Scholar
  23. HOLT, R. C. 1972. Some deadlock properties on computer systems. ACM Comput. Surv. 4, 3 (Sept.), 179-196. Google ScholarGoogle Scholar
  24. JAGANNATHAN, J. R., AND VASUDEVAN, R. 1982. A distributed deadlock detection and resolution scheme; performance study. In Proceedings of the Third International Conference on Distributed Computing Systems (Miami, Fla.). IEEE, New York, pp. 496-501.Google ScholarGoogle Scholar
  25. LAMPORT, L. 1978. Time, clocks, and the ordering of events in distributed systems. Commun. ACM 21, 7 (July), 558-565. Google ScholarGoogle Scholar
  26. MENASCE, D., AND MUNTZ, R. 1979. Locking and deadlock detection in distributed databases. IEEE Trans. So{tw. Eng. SE-5, 3 (May).Google ScholarGoogle Scholar
  27. MISRA, J. 1983. Detecting termination of distributed computations using markers. In Proceedings of the ACM Symposium on Principles of Distributed Computing (Montreal, Canada, Aug.). ACM, New York, pp. 290-294. Google ScholarGoogle Scholar
  28. MISRA, J., AND CHANDY, K. M. 1982a. A distributed graph algorithm: Knot detection. A CM Trans. Program. Lang. Syst. 4, 4 (Oct.), 678-686. Google ScholarGoogle Scholar
  29. MISRA, J., AND CHANDY, K. M. 1982b. Termination detection of diffusing computations in communicating sequential processes. A CM Trans. Program. Lang. Syst. 4, i (Jan.), 37-43. Google ScholarGoogle Scholar
  30. MITCHELL, D. P., AND MERRITT, M. J. 1984. A distributed algorithm for deadlock detection and resolution. In Proceedings of the A CM Symposium on Principles o{ Distributed Computing. ACM, New York, pp. 282-284. Google ScholarGoogle Scholar
  31. NATARAJAN, N. 1986. A distributed scheme for detecting communication deadlock. IEEE Trans. So{tw. Eng. SE-12, 4 (Apr.), 531-537. Google ScholarGoogle Scholar
  32. OBERMARCK, R. 1980. Deadlock detection for all resource classes. Res. Rep. RJ2955, IBM Research Laboratory, San Jose, Calif.Google ScholarGoogle Scholar
  33. OBERMARCK, R. 1982. Distributed deadlock detection algorithm. ACM Trans. Database Syst. 7, 2 (June), 187-208. Google ScholarGoogle Scholar
  34. PAPADIMITRIOU, C. 1987. The Theory of Database Concurrency Control. Computer Science Press, Rockville, Md. Google ScholarGoogle Scholar
  35. R~UCHLE, T., AND TOUEG, S. 1983. Exposure to deadlock for communicating processes is hard to detect. Tech. Rep. TR 83-555, Cornell Univ., Ithaca, N.Y. Google ScholarGoogle Scholar
  36. SINHA, M. K., AND NATARAJAN, N. 1984. A distributed deadlock detection algorithm based on timestamps. In Proceedings of the 4th International Con{erence on Distributed Computing Systerns. IEEE, New York, pp. 546-556.Google ScholarGoogle Scholar
  37. ZOBEL, D. 1983. The deadlock problem: A classifying bibliography. Operat. Syst. Rev. 17, 2 (Oct.), 6-15. Google ScholarGoogle Scholar
  38. BADAL, D. Z., AND GEHL, M. T. 1983. On deadlock detection in distributed computing systems. In IEEE INFOCOM. IEEE, New York.Google ScholarGoogle Scholar
  39. BRACHA, G. 1985. Randomized agreement protocols and distributed deadlock detection algorithms. Ph.D. dissertation, Cornell Univ., Ithaca, N.Y. Google ScholarGoogle Scholar
  40. COHEN, S., AND LEHMANN, D. 1982. Dynamic systems and their distributed termination. In Proceedings of the A CM Symposium on Principles of Distributed Computing (Ottawa, Canada, Aug.). ACM, New York, pp. 29-33. Google ScholarGoogle Scholar
  41. DIJKSTRA, E. W. 1982. Distributed termination detection revisited. EWD 828, Plataanstraat 5, 5671 A1 Nuenen, The Netherlands.Google ScholarGoogle Scholar
  42. FRANCEZ, N. 1980. Distributed termination. A CM Trans. Program. Lang. Syst. 2, 1 (Jan.), 42-55. Google ScholarGoogle Scholar
  43. FRANCEZ, N., AND RODEH, M. 1982. Achieving distributed termination without freezing. IEEE Trans. Softw. Eng. SE-8, 3 (May), 287-292.Google ScholarGoogle Scholar
  44. FRANCEZ, N., RODEH, M., AND SINTZOFF, M. 1981. Distributed termination with interval assertions. In Proceedings of Formalization of Programming Concepts (Peninsula, Spain). Springer Verlag, New York. Google ScholarGoogle Scholar
  45. GOLDMAN, B. 1985. Deadlock detection in computer networks. Tech. Rep. LCS TR-185, Massachusetts Institute of Technology, Cambridge, Mass. Google ScholarGoogle Scholar
  46. GOUDA, M. 1981. Distributed state exploration for protocol validation. Tech. Rep. TR-185, Dept. of Computer Sciences, Univ. of Texas, Austin, Tex. Google ScholarGoogle Scholar
  47. ISLOOR, S. S., AND MARSLAND, T. A. 1980. The deadlock problem: An overview. Computer (Sept.), 58-70.Google ScholarGoogle Scholar
  48. JAGANNATHAN, J. R., AND VASUDEVAN, R. 1982. Detection and resolution of deadlocks in distributed systems. Tech. Rep. 82-108-27, Univ. of Calgary, Calgary, Alta., Canada.Google ScholarGoogle Scholar
  49. KORTH, H. F., KRISHNAMURTHY, R., NIGAM, A., AND ROBINSON, J. T. 1983. A framework for understanding distributed (deadlock detection) algorithms. In Proceedings of the Second A CM Symposium on Principles of Database Systems (Atlanta, Ga., Mar.). ACM, New York, pp. 192-201. Google ScholarGoogle Scholar
  50. MARSLAND, T. A., AND ISLOOR, S. S. 1980. Detection of deadlocks in distributed database systems. INFOR 18, i (Feb.), 1-20.Google ScholarGoogle Scholar
  51. TSAI, W. 1982. Distributed deadlock detection in distributed database systems. Ph.D. dissertation, Univ. of Illinois at Urbana-Champaign, Urbana, Ill. Google ScholarGoogle Scholar
  52. TSAI, W., AND BELFORD, G. 1982. Detecting deadlock in distributed systems. In IEEE INFOCOM. IEEE, New York, pp. 89-95.Google ScholarGoogle Scholar
  53. WUU, G. T., AND BERNSTEIN, A. J. 1985. False deadlock detection in distributed systems. IEEE Trans. Softw. Eng. SE-11, 8 (Aug.), 820-821.Google ScholarGoogle Scholar

Recommendations

Reviews

Gerard J. Holzmann

This readable and instructive paper focuses on algorithms for deadlock detection, rather than deadlock prevention or resolution. Knapp begins by formulating a general model for resource allocation in distributed systems, distinguishing between six different models of increasing generality. In the simplest model, any process within the system may request and monopolize no more than one resource at a time, while in the most general model, all possible variants of overlapping requests for multiple resources are permitted. The types of deadlock that can result in each type of system are different, and the complexity of the required deadlock detection algorithms also differs. Knapp classifies deadlock detection algorithms into four main types: (1) path-pushing algorithms, (2) edge-chasing algorithms, (3) diffusing computations, and (4) global state detection algorithms. In a path-pushing algorithm, for instance, the processes exchange complete information about the resources they are waiting for. Each process is then able to construct a wait-for-graph of the system as a whole and detect the deadlock configurations. Knapp writes: “One noteworthy point about path-pushing algorithms is that many of them were found to be incorrect, either by not detecting true deadlocks, by discovering phantom deadlocks, or both.” Knapp gives a sufficient number of examples of published and “proved” algorithms to validate his claim. In an edge-chasing algorithm, the processes can issue special messages called probes. A probe message is forwarded to all processes that the receiving process waits for. A deadlock can be declared if a probe message makes its way back to the originating process. As an example of a simple and well-designed algorithm of this type, the author discusses in some detail the work of Mitchell and Merritt [1]. Their algorithm has the added advantage that the proofs of correctness are elegant and, says Knapp, “fun to read (and write).” The last two types of algorithms, diffusing computations and global state detection, are based on early work by Dijkstra and Lamport, respectively. Knapp gives detailed motivations and examples of each type of algorithm. One of Knapp's conclusions is particularly worth quoting: “The large number of errors in published algorithms addressing the problem of distributed deadlock detection . . . shows that only rigorous proofs, using as little operational argumentation as possible, suffice to show the correctness of these algorithms.” Some of these errors have escaped notice for many years. This paper is a laudable attempt to set the record straight.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in

Full Access

  • Published in

    cover image ACM Computing Surveys
    ACM Computing Surveys  Volume 19, Issue 4
    Dec. 1987
    56 pages
    ISSN:0360-0300
    EISSN:1557-7341
    DOI:10.1145/45075
    Issue’s Table of Contents

    Copyright © 1987 ACM

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 1 December 1987
    Published in csur Volume 19, Issue 4

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • article

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader