Patent ID: 8032637

Claim:
A computer-implemented method for redistributing lock mastership, at least a portion of the method being performed by a computing system comprising at least one processor, the method comprising: identifying a set of discrete computing-resource portions; identifying a cluster of nodes, each node having lock mastership over a subset of the discrete computing-resource portions; identifying a cluster event, the cluster event requiring a redistribution of lock mastership; determining a new mastership load distribution to apply across the cluster of nodes; for each node in the cluster of nodes: deallocating, from the lock mastership of the node, a sufficient number of discrete computing-resource portions to arrive at a lock-mastership load for the node no higher than a target number for the node as indicated by the new mastership load distribution, wherein deallocating, from the lock mastership of the node, the sufficient number of discrete computing-resource portions comprises: initializing an appearances array to comprise the new mastership load distribution; identifying an allocation array, the allocation array comprising nodes to which lock-mastership of a subset of discrete computing-resource portions is allocated; for each discrete computing-resource portion: identifying an assigned node from a part of the allocation array corresponding to the discrete computing-resource portion; identifying a remaining number in the appearances array corresponding to the assigned node; if the remaining number is zero: marking the part of the allocation array corresponding to the discrete computing-resource portion as without any node; if the remaining number is not zero: decrementing the remaining number; identifying a set of deallocated discrete computing-resource portions; for each node in the cluster of nodes: allocating, to the lock mastership of the node, a sufficient number of discrete computing-resource portions from the set of deallocated discrete computing-resource portions to arrive at a lock-mastership load for the node no lower than the target number for the node as indicated by the new mastership load distribution.