主权项 |
1. A system, comprising:
a plurality of computing nodes, each comprising at least one processor and memory, wherein the plurality of computing nodes is configured to implement a data storage service; wherein the data storage service maintains data on behalf of one or more storage service clients, wherein maintaining the data comprises storing two or more replicas of the data on respective computing nodes in the system, wherein the two or more replicas make up a replica group, wherein at most one of the replicas in the replica group can act as a master replica for the replica group at a time, and wherein replicas in the replica group that are not acting as the master replica act as slave replicas in the replica group; wherein one of the replicas is configured to assume the role of master replica for the replica group, wherein assuming the role of master replica comprises:
providing an indication of interest in assuming the role of master replica to a service or manager external to the data storage service; andreceiving credentials from the external service or manager indicating that the one of the replicas has been selected to assume the role of master replica for the replica group; wherein subsequent to assuming the role of master replica, the one of the replicas is further configured to:
generate a lease, wherein the lease represents an authorization of the one of the replicas to act as the master replica for the replica group for a pre-determined lease period;send a message indicating the lease to the other replicas in the replica group as a replicated write operation;in response to determining that the message indicating the lease has been committed in the data storage system, begin servicing all consistent read operations that are directed to the replica group; andprior to the pre-determined lease period expiring, in response to determining that the external service or manager is no longer communicating with the one of the replicas, continue to service all consistent read operations that are directed to the replica group until the pre-determined lease period expires. |