Patent ID: 8868748

Claim:
A computer program product for managing locks on shared resources in a distributed computer system comprising: a non-transitory computer readable storage medium having computer readable program code embodied therewith, the computer readable program code comprising computer readable program code configured to: receive at a first primary node a first local lock state from a first secondary node of a plurality of secondary nodes, wherein the first local lock state provides an amalgamated representation of lock states of one or more tasks on the first secondary node and comprises a lock request for access to a shared resource by one or more tasks on the first secondary node, a requested lock mode for the lock request, and merged state information of tasks on the first secondary node waiting for or holding locks on shared resources, and wherein the merged state information indicates a group lock mode generated by comparing lock modes of the tasks on the first secondary node waiting for or holding locks on the shared resources and identifying a lock mode compatible with each of the lock modes of the tasks as the group lock mode based on the comparing; at the first primary node, if the first local lock state is not stale, grant the lock request if no conflicts exist, and otherwise add the first local lock state to a priority queue for the shared resource requested in the lock request and processing the priority queue for the shared resource requested in the lock request; at the first primary node, generate a first global lock state in response to the first local lock state, wherein the first global lock state comprises a holdable lock mode that is granted to the first secondary node for the shared resource requested in the lock request and merged state information of the plurality of secondary nodes with respect to the lock request; and communicate the first global lock state from the first primary node to the first secondary node; at a global deadlock detector, receive and store lock conflict information from two or more of the plurality of secondary nodes, wherein for each of the two or more secondary nodes the lock conflict information comprises local lock waits and lock interests for one or more tasks on that secondary node; at the global deadlock detector, detect a global deadlock using the received lock conflict information, wherein a global deadlock is a deadlock between tasks on two or more different ones of the plurality of secondary nodes; at the global deadlock detector, resolve the detected global deadlock by selecting one of the deadlocked tasks as a victim; and communicate the victim selection from the global deadlock detector to the secondary node where the selected victim task is located.