System and method for log conflict detection and resolution in a data store
First Claim
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 in the replica group is configured to;
receive a log record to be appended to a log maintained by the replica, wherein the log comprises a plurality of log records, wherein each log record indicates an update to the data being maintained on behalf of the storage service clients or an update to the membership of the replica group, and wherein each log record comprises metadata associated with the update or the replica group that receive log records from the master replica, wherein the metadata comprises;
a sequence number that was assigned to the log record when the log record was generated and that comprises a value in a strictly increasing series; and
a master reign identifier indicating a reign of a particular master replica over the replica group when the log record was generated;
compare metadata for the received log record to metadata for one or more other log records in the log to determine a conflict in master reign between the received log record and the one or more other log records;
determine an action to be taken in response to receiving the log record dependent on results of the comparison, wherein the action resolves the determined conflict; and
take the determined action.
0 Assignments
0 Petitions
Accused Products
Abstract
A system that implements a data storage service may store data on behalf of storage service clients. The system may maintain data in multiple replicas that are stored on respective computing nodes in the system. Updates to the stored data and to the membership of replica groups are propagated as replicated log records. A replica receiving a log record may compare metadata in the received log record to corresponding metadata in a log record that was previously appended to its log to determine a response. The metadata may include a sequence number, a lock generation identifier, an epoch identifier, or an indication of an epoch change. The replica may append the received log record to its log, drop the received log record, or cache the received log record for future use. If a log conflict indicates an invalid log stream branch, one or more log records may be deleted.
12 Citations
20 Claims
-
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 in the replica group is configured to; receive a log record to be appended to a log maintained by the replica, wherein the log comprises a plurality of log records, wherein each log record indicates an update to the data being maintained on behalf of the storage service clients or an update to the membership of the replica group, and wherein each log record comprises metadata associated with the update or the replica group that receive log records from the master replica, wherein the metadata comprises; a sequence number that was assigned to the log record when the log record was generated and that comprises a value in a strictly increasing series; and a master reign identifier indicating a reign of a particular master replica over the replica group when the log record was generated; compare metadata for the received log record to metadata for one or more other log records in the log to determine a conflict in master reign between the received log record and the one or more other log records; determine an action to be taken in response to receiving the log record dependent on results of the comparison, wherein the action resolves the determined conflict; and take the determined action. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A method, comprising:
performing by a computer; receiving, by a replica in a replica group that comprises two or more replicas, a log record to be appended to a log maintained by the replica, wherein the log comprises a plurality of log records, wherein each log record comprises metadata associated with an update to be applied in the replica group, wherein the two or more replicas maintain data on respective computing nodes in a data store, 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; comparing, by the replica, at least one element of the metadata for the received log record to a corresponding element of the metadata for a log record that was previously appended to the log, wherein the comparing determines whether a conflict in master reign exists between the received log record and one or more log records that were previously appended to the log, and wherein the metadata comprises a master reign identifier indicating a reign of a particular master replica over the replica group when the log record was generated and a sequence number that was assigned to the log record when the log record was generated; determining, by the replica, an action to be taken in response to receiving the log record dependent on results of the comparison, wherein the action resolves any determined conflict; and taking, by the replica, the determined action. - View Dependent Claims (7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
-
18. A non-transitory computer-readable storage medium storing program instructions that if executed on one or more computers cause the one or more computers to perform:
-
receiving, at replica in a replica group that comprises two or more replicas, a log record to be appended to a log maintained by the replica, wherein the log comprises a plurality of log records, wherein each log record comprises metadata associated with an update to be applied in the replica group, wherein the two or more replicas maintain data on respective computing nodes in a data store, 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; comparing at least one element of the metadata for the received log record to a corresponding element of the metadata for a log record that was previously appended to the log, wherein the comparing determines whether a conflict in master reign exists between the received log record and one or more log records that were previously appended to the log, and wherein the metadata comprises a master reign identifier indicating a reign of a particular master replica over the replica group when the log record was generated and a sequence number that was assigned to the log record when the log record was generated; determining an action to be taken in response to receiving the log record dependent on results of the comparison, wherein the action resolves any determined conflict; and taking the determined action. - View Dependent Claims (19, 20)
-
Specification