CA2322604C

Deadlock management in database systems with demultiplexed connections

Abstract

A deadlock management system for a demultiplexed database system having worker agents andapplications associated with and disassociated from the worker agents. Applications holding lockson database resources and capable of retaining locks when disassociated from worker agents.Providing each application with a flag set in accordance with the existing value of the applicationflag and in accordance with the state of applications holding and requesting locks. The deadlockmanagement system providing for applications to be placed on a wait queue, a priority queue, orprovided worker agents or overflow worker agents depending on the flag value for the application.Declaring deadlocks based on the flag value of applications and on the state of the lock wait graphshowing applications holding and requesting locks.

CA2322604C, drawing sheet 1
Sheet 1 of 2

Term

Term ended

Expired 6 October 2020, 6 years ago.

  1. Priority and filed
  2. Granted
  3. Expired
  4. Today

14 claims: 3 independent, 11 dependent

  1. 1
    CA 02322604 2000-10-06 The embodiments of the invention in which an exclusive property or privilege is claimed are defined as follows:1. A deadlock management system for a database system, the database system comprising a set of applications selectively requesting and holding locks on database resources, a pool of worker agents comprising normal worker agents and overflow worker agents, an application scheduler, a wait queue, a priority queue, and a deadlock detector, the database system supporting an application holding a lock while disassociated from a worker agent, the deadlock management system comprising: means for marking an application with a flag value based on the existing application flag value and on the state of applications requesting and holding locks on database resources, means for the application scheduler to respond to an application request for a worker agent from the pool and to selectively provide a normal worker agent, an overflow worker agent, or place the application on the wait queue or on the priority queue, based on the application flag value, means for clearing the application flag value when an application is provided with a worker agent, means for the deadlock detector to poll an application and means for the deadlock detector to declare a deadlock where the application has a specified flag value, and the application holds a lock on a database resource requested by another application.
  2. 7
    A deadlock management system for a database system, the database system comprising a set of applications selectively requesting and holding locks on database resources, a pool of worker agents comprising normal worker agents and overflow worker agents, an application scheduler, a wait queue, apriority queue, and a deadlock detector, the database system supporting an application holding a lock while disassociated from a worker agent, the deadlock management system comprising:means for marking an application with a flag value based on the existing application flag value and on the state of applications requesting and holding locks on database resources, comprising, means for marking an application with a flag value W where the application becomes disassociated from a worker agent, means for marking an application with a flag value H where the application has a flag value W and where the application holds a lock on a database resource requested by another application, means for marking an application with a flag value D where the application requests a worker agent, has a flag value H and there is no normal worker agent or overflow worker CA9-2000-0031 CA 02322604 2000-10-06 agent available for the application, means for marking an application with the flag value Q where the application is placed on the wait queue, and means for marking an application with the flag value D where the application has the flag value Q and a worker agent associated with another application requests a lock held by the application having the flag value Q. means for the application scheduler to respond to an application request for a worker agent from the pool and to selectively provide a normal worker agent, an overflow worker agent, or place the application on the wait queue or on the priority queue, based on the application flag value, comprising means for responding to a request for a worker agent from an application with flag value H by obtaining a normal worker agent if available and alternatively providing an overflow worker agent, further comprising means for placing the application on the priority queue where no overflow worker agent is available, and means for responding to a request for a worker agent from an application with flag value W by obtaining a normal worker agent if available and alternatively by placing the application on the wait queue. means for clearing the application flag value when an application is provided with a worker agent, means for the deadlock detector to poll an application and means for the deadlock detector to declare a deadlock where the application has a specified flag value and the application holds a lock on a database resource requested by another application, comprising, means for declaring a deadlock where an application has a flag value D and the application CA9-2000-0031 CA 02322604 2000-10-06 holds a lock on a database resource that is requested by another application, the deadlock detector further comprising a lock wait deadlock graph and a resource representation, the lock wait deadlock graph comprising means to represent applications requesting and holding locks on database resources whereby the deadlock detector determines if an application holds a lock requested by another application, means to select an application holding a lock and to require the application to release the lock, following detection of a deadlock on the lock. 8.. A method for deadlock management in a database system, the database system comprising a set of applications selectively requesting and holding locks on database resources, a pool of worker agents comprising normal worker agents and overflow worker agents, a wait queue, and a priority queue, the database system supporting an application holding a lock while disassociated from a worker agent, the method of deadlock management comprising the following steps marking an application with a flag value based on the existing application flag value and on the state of applications requesting and holding locks on database resources, responding to an application request for a worker agent from the pool and selectively providing a normal worker agent, an overflow worker agent, or placing the application on the wait queue or on the priority queue, based on the application flag value, clearing the application flag value when an application is provided with a worker agent, and polling an application and declaring a deadlock where the application has a specified flag value and the application holds a lock on a database resource requested by another application.
  3. 13
    14. A method of deadlock management for a database system, the database system comprising a set of applications selectively requesting and holding locks on database resources, apool of worker agents comprising normal worker agents and overflow worker agents, a wait queue, and a priority queue, the database system supporting an application holding a lock while disassociated from a worker agent, the method of deadlock management comprising the steps of:marking an application with a flag value based on the existing application flag value and on the state of applications requesting and holding locks on database resources, comprising the steps of: marking an application with a flag value W where the application becomes disassociated from a worker agent, marking an application with a flag value H where the application has a flag value W and where the application holds a lock on a database resource requested by another application, marking an application with a flag value D where the application requests a worker agent, has a flag value H and there is no normal worker agent or overflow worker agent available CA9-2000-0031 CA 02322604 2000-10-06 for the application, marking an application with the flag value Q where the application is placed on the wait queue, and marking an application with the flag value D where the application has the flag value Q and a worker agent associated with another application requests a lock held by the application having the flag value Q, responding to an application request for a worker agent from the pool and selectively providing a normal worker agent, an overflow worker agent, or placing the application on the wait queue or on the priority queue, based on the application flag value, comprising the steps of: responding to a request for a worker agent from an application with flag value H by obtaining a normal worker agent if available and alternatively by providing an overflow worker agent, further comprising the step of placing the application on the priority queue where no overflow worker agent is available, and responding to a request for a worker agent from an application with flag value W by obtaining a normal worker agent if available and alternatively by placing the application on the wait queue. clearing the application flag value when an application is provided with a worker agent, polling an application and declaring a deadlock where the application has a specified flag value and the application holds a lock on a database resource requested by another application, comprising the step of declaring a deadlock where an application has a flag value D and the application holds a lock on a database resource that is requested by another application, the database system further comprising a lock wait deadlock graph and a CA9-2000-0031 CA 02322604 2000-10-06 resource representation, the lock wait deadlock graph comprising means to represent applications requesting and holding locks on database resources whereby the step of declaring a deadlock comprises the step of determining if an application holds a lock requested by another application by accessing the lock wait graph, and 5 selecting an application holding a lock and requiring the application to release the lock, following detection of a deadlock on the lock.