CPC G06F 9/524 (2013.01) [G06F 9/466 (2013.01)] | 19 Claims |
1. A computer implemented method comprising:
performing first processing that includes role switching of a winner role and a loser role between a first node and a second node, wherein the winner role and the loser role are used in connection with resolving detected deadlocks or potential deadlocks, wherein prior to performing said first processing, the first node has the loser role and the second node has the winner role, wherein said first processing includes:
the first node updating a first current state of the first node from a value, denoting that the first node has the loser role and the second node has the winner role, to a first value indicating a “no winner” state and that role switching of the winner role and the loser role is in progress;
detecting at a first point in time, by the first node while the first current state of the first node has the first value indicating the “no winner” state, a deadlock or potential deadlock between the first node performing processing for a first transaction and the second node performing processing for a second transaction;
responsive to said detecting at the first point in time, by the first node while the first current state of the first node has the first value indicating the “no winner” state, the deadlock or potential deadlock between the first node and the second node, waiting to perform deadlock resolution processing in accordance with the loser role and the winner role to resolve the deadlock or potential deadlock detected in said detecting by the first node by placing a first conflicting lock request between the first transaction and the second transaction on a first queue until a second point in time when the first current state of the first node has been further updated by the first processing from the first value to a second value, wherein the first value indicates the “no winner” state, and wherein the first current state of the first node having the second value indicates that the first node has the winner role and that the second node has the loser role;
while the first current state of the first node as updated by said updating has the first value denoting the “no winner” state and subsequent to said waiting to perform deadlock resolution processing to resolve the deadlock or potential deadlock detected, the first node sending to the second node a new winner value indicating that the first node is transitioning from the loser role to the winner role and also indicating that the second node is transitioning from the winner role to the loser role;
responsive to the second node receiving the new winner value from the first node, the second node updating a second current state of the second node to the second value in accordance with the new winner value, where the second value of the second current state after updating by the second node indicates that the first node has the winner role and the second node has the loser role;
subsequent to the second node updating the second current state to the second value, the second node sending a reply to the first node; and
in response to the first node receiving the reply from the second node, the first node updating, at the second point in time, the first current state of the first node from the first value indicating the “no winner” state to the second value indicating that the first node has the winner role and the second node has the loser role.
|