Patent ID: 8719225

Claim:
A method, comprising: performing, by a computer: a replica in a replica group that comprises two or more replicas: receiving a log record to be appended to a log maintained by the replica, wherein the log comprises a plurality of log records, wherein the received log record and each log record in the log 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 for the replica group act as slave replicas in the replica group; comparing at least one element of the metadata in the received log record to a corresponding element of the metadata in a log record that was previously appended to the log, wherein the metadata comprises a lock generation identifier that indicates a particular acquisition of an external lock for the replica group by a replica acting as the master replica for the replica group, wherein the lock generation identifier value was fixed by the replica that generated the log record at a time when the replica that generated the log record was acting as the master replica for the replica group and owned the external lock for the replica group, and wherein the metadata further comprises one or more of: a sequence number that was assigned to the log record when the log record was generated, an epoch identifier that was assigned to the log record when the log record was generated and that indicates an epoch during which the log record was produced, wherein an epoch is a particular time period during which a given replica was acting as the master replica for the replica group, or an element whose value indicates whether or not the log record is associated with an epoch change; determining an action to be taken in response to receiving the log record dependent on results of the comparison; and taking the determined action.