US8843441B1

System and method for maintaining a master replica for reads and writes in a data store

Summary by NHIP

Master replica selection system

The system maintains data replicas across computing nodes and selects a master replica via an external service. The master generates a lease authorizing consistent reads and writes, preventing other replicas from servicing reads until the lease expires.

Claim Score by NHIP

Read claim 17, the broadest

Abstract

A system that implements a data storage service may store data on behalf of clients in multiple replicas on respective computing nodes. The system may employ an external service to select a master replica for a replica group. The master replica may service consistent read operations and/or write operations that are directed to the replica group (or to a data partition stored by the replica group). The master replica may employ a quorum based mechanism for performing replicated write operations, and a local lease mechanism for determining the replica authorized to perform consistent reads, even when the external service is unavailable. The master replica may propagate local leases to replica group members as replicated writes. If another replica assumes mastership for the replica group, it may not begin servicing consistent read operations that are directed to the replica group until the lease period for a current local lease expires.

US8843441B1, drawing sheet 1
Sheet 1 of 38

Term

6 yearsleft in the term

Expires 24 September 2032, including 251 days of term adjustment.

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

28 claims: 4 independent, 24 dependent

  1. 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;and receiving 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;and prior 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;wherein the one of the replicas is further configured to service all write operations directed to the replica group, wherein servicing a write operation comprises: sending a message indicating the write operation as a replicated write to the other replicas in the replica group;determining whether the message indicating the write operation meets a pre-determined durability requirement for write operations in the system;and committing the write operation in the data storage service in response to determining that the write operation meets the pre-determined durability requirement for write operations in the system;and wherein in response to determining that the external service or manager is no longer communicating with the one of the replicas, the one of the replicas is further configured to continue to service all write operations directed to the replica group until another replica assumes the role of master replica for the replica group or until it is determined that another replica is attempting to assume the role of master replica for the replica group.
  2. 5
    A method, comprising:performing, by a computer: one of a group of two or more replicas assuming the role of master replica for the two or more replicas, wherein the two or more replicas store data on respective computing nodes of a plurality of computing nodes that are configured to implement a data store, 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 said 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;and receiving 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;subsequent to said assuming the role of master replica, the one of the replicas: generating 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;sending 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 store, beginning to service all consistent read operations that are directed to the replica group during the lease period;servicing all write operations directed to the replica group, wherein servicing a write operation comprises: sending a message indicating the write operation as a replicated write to the other replicas in the replica group;determining whether the message indicating the write operation meets a pre-determined durability requirement for write operations in the system;and committing the write operation in the data storage service in response to determining that the write operation meets the pre-determined durability requirement for write operations in the system;and in response to determining that the external service or manager is no longer communicating with the one of the replicas, the one of the replicas continuing to service all write operations directed to the replica group until another replica assumes the role of master replica for the replica group or until it is determined that another replica is attempting to assume the role of master replica for the replica group.
  3. 17
    Broadest claimClaim Score 24, narrow(NHIP)A non-transitory, computer-readable storage medium storing program instructions that when executed on one or more computers cause the one or more computers to perform:maintaining data in a distributed data store, wherein maintaining the data comprises maintaining two or more replicas of the data stored on respective computing nodes, 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;one of the two or more replicas assuming the role of master replica for the replica group, wherein said assuming comprises receiving credentials from a service or manager that is external to the data store indicating that the one of the replicas has been selected to assume the role of master replica for the replica group;subsequent to said assuming the role of master replica, the one of the replicas: generating 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;sending 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 store, beginning to service all consistent read operations that are directed to the replica group during the lease period;servicing all write operations directed to the replica group during the pre-determined lease period, wherein servicing a write operation comprises: sending a message indicating the write operation as a replicated write to the other replicas in the replica group;determining whether the message indicating the write operation meets a pre-determined durability requirement for write operations in the system;and committing the write operation in the data storage service in response to determining that the write operation meets the pre-determined durability requirement for write operations in the system;and in response to determining that the external service or manager is no longer communicating with the one of the replicas, continuing to service all write operations directed to the replica group until another replica assumes the role of master replica for the replica group or until it is determined that another replica is attempting to assume the role of master replica for the replica group.
  4. 23
    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 store;wherein the data store stores data in two or more replicas on respective computing nodes in the system, and 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 to assume the role of master replica the one of the replicas is configured to: provide an indication of interest in assuming the role of master replica to a service or manager external to the data storage service;and receive 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 store, begin servicing all consistent read operations that are directed to the replica group;and subsequent to a pre-determined heartbeat period expiring and prior to the pre-determined lease period expiring: generate a second lease, wherein the second lease represents a renewal of the authorization of the one of the replicas to act as the master replica for the replica group for an additional lease period;send a message indicating the second lease to the other replicas in the replica group as a replicated write operation;and in response to determining that the message indicating the second lease has been committed in the data store, continue servicing at least some consistent read operations that are directed to the replica group subsequent to the pre-determined lease period expiring and prior to the additional lease period expiring;wherein the one of the replicas is further configured to service all write operations directed to the replica group, wherein to service a write operation the one of the replicas is further configured to: send a message indicating the write operation as a replicated write to the other replicas in the replica group;determine whether the message indicating the write operation meets a pre-determined durability requirement for write operations in the system;and commit the write operation in the data storage service in response to determining that the write operation meets the pre-determined durability requirement for write operations in the system;and wherein, in response to determining that the external service or manager is no longer communicating with the one of the replicas, the one of the replicas is configured to continue servicing all write operations directed to the replica group until another replica assumes the role of master replica for the replica group or until it is determined that another replica is attempting to assume the role of master replica for the replica group.