System, method, and computer program product for multi-master replication conflict resolution
First Claim
1. A method of resolving a conflict when performing data replication in a multi-mastered system, the method comprising the computer implemented steps of:
- receiving, by a first data processing system, a replication command generated by a second data processing system;
identifying the conflict between a first entry managed by the first data processing system and a second entry managed by the second data processing system, wherein the conflict exists when a first update occurs to the first entry and a second update occurs to the second entry prior to the data replication in the multi-mastered system, wherein the replication command generated by the second data processing system includes the second update performed by the second data processing system on the second entry, a first timestamp read from the second entry prior to the second update and a second timestamp that identifies the time at which the second update was performed, wherein the step of identifying further includes;
comparing the first timestamp with a third timestamp, wherein the third timestamp is read from the first entry and identifies the time at which the first update was performed to the first entry; and
determining that the first timestamp and the third timestamp are unequal;
responsive to identifying the conflict, determining a one of the first entry and the second entry that is a most recently modified entry using the first timestamp, the second timestamp and the third time-stamp, wherein the one of the first entry and the second entry not identified as the most recently modified entry is a least recently modified entry;
responsive to determining that the second entry is the most recently modified entry, replacing the first entry with the second entry to resolve the conflict when performing the data replication in the multi-mastered system, wherein the step of replacing the first entry with the second entry includes;
sending, by the first data processing system, a request for a refresh operation to the second data processing system; and
responsive to receiving the request;
returning, by the second data processing system, an insert command including the second entry to the first data processing system;
responsive to determining that the first entry is the most recently modified entry, replacing the second entry with the first entry to resolve the conflict, wherein the step of replacing the second entry with the first entry includes;
discarding, by the first data processing system, the second update; and
sending, by the first data processing system, an insert command including the first entry to the second data processing system; and
responsive to determining the most recently modified entry, logging the least recently modified entry in a record that defines the conflict that has been resolved, wherein the step of replacing and logging are performed by the first data processing system when it is determined that the second entry is the most recently modified entry; and
are performed by the second data processing system when it is determined that the first entry is the most recently modified entry.
1 Assignment
0 Petitions
Accused Products
Abstract
A method, computer program product, and a data processing system for performing data replication in a multi-mastered system is provided. A first data processing system receives a replication command generated by a second data processing system. A conflict is identified between a first entry maintained by the first data processing system and a second entry of the second data processing system. Responsive to identifying the conflict, a one of the first entry and the second entry is determined to be a most recently modified entry and a remaining entry of the first and second entries is determined to be a least recently modified entry. The least recently modified entry is replaced with the most recently modified entry, and the least recently modified entry is logged.
35 Citations
2 Claims
-
1. A method of resolving a conflict when performing data replication in a multi-mastered system, the method comprising the computer implemented steps of:
-
receiving, by a first data processing system, a replication command generated by a second data processing system; identifying the conflict between a first entry managed by the first data processing system and a second entry managed by the second data processing system, wherein the conflict exists when a first update occurs to the first entry and a second update occurs to the second entry prior to the data replication in the multi-mastered system, wherein the replication command generated by the second data processing system includes the second update performed by the second data processing system on the second entry, a first timestamp read from the second entry prior to the second update and a second timestamp that identifies the time at which the second update was performed, wherein the step of identifying further includes; comparing the first timestamp with a third timestamp, wherein the third timestamp is read from the first entry and identifies the time at which the first update was performed to the first entry; and determining that the first timestamp and the third timestamp are unequal; responsive to identifying the conflict, determining a one of the first entry and the second entry that is a most recently modified entry using the first timestamp, the second timestamp and the third time-stamp, wherein the one of the first entry and the second entry not identified as the most recently modified entry is a least recently modified entry; responsive to determining that the second entry is the most recently modified entry, replacing the first entry with the second entry to resolve the conflict when performing the data replication in the multi-mastered system, wherein the step of replacing the first entry with the second entry includes; sending, by the first data processing system, a request for a refresh operation to the second data processing system; and responsive to receiving the request;
returning, by the second data processing system, an insert command including the second entry to the first data processing system;responsive to determining that the first entry is the most recently modified entry, replacing the second entry with the first entry to resolve the conflict, wherein the step of replacing the second entry with the first entry includes; discarding, by the first data processing system, the second update; and sending, by the first data processing system, an insert command including the first entry to the second data processing system; and responsive to determining the most recently modified entry, logging the least recently modified entry in a record that defines the conflict that has been resolved, wherein the step of replacing and logging are performed by the first data processing system when it is determined that the second entry is the most recently modified entry; and
are performed by the second data processing system when it is determined that the first entry is the most recently modified entry.
-
-
2. A computer program product in a computer recordable-type medium for resolving a conflict when performing data replication in a multi-mastered system, the computer program product comprising:
-
first instructions for receiving, by a first data processing system, a replication command generated by a second data processing system; second instructions for identifying the conflict between a first entry managed by the first data processing system and a second entry managed by the second data processing system, wherein the conflict exists when a first update occurs to the first entry and a second update occurs to the second entry prior to the data replication in the multi-mastered system, wherein the replication command generated by the second data processing system includes the second update performed by the second data processing system on the second entry, a first timestamp read from the second entry prior to the second update and a second timestamp that identifies the time at which the second update was performed, wherein the second instructions further includes; instructions for comparing the first timestamp with a third timestamp, wherein the third timestamp is read from the first entry and identifies the time at which the first update was performed to the first entry; and instructions for determining that the first timestamp and the third timestamp are unequal; third instructions responsive to identifying the conflict, for determining a one of the first entry and the second entry that is a most recently modified entry using the first timestamp, the second time-stamp and the third timestamp, wherein the one of the first entry and the second entry not identified as the most recently modified entry is a least recently modified entry; fourth instructions responsive to determining that the second entry is the most recently modified entry, for replacing the first entry with the second entry to resolve the conflict when performing the data replication in the multi-mastered system, wherein the fourth instructions includes; instructions for sending, by the first data processing system, a request for a refresh operation to the second data processing system; and instructions responsive to receiving the request;
for returning, by the second data processing system, an insert command including the second entry to the first data processing system;fifth instructions responsive to determining that the first entry is the most recently modified entry, for replacing the second entry with the first entry to resolve the conflict, wherein the fifth instructions includes; instructions for discarding, by the first data processing system, the second update; and instructions for sending, by the first data processing system, an insert command including the first entry to the second data processing system; and sixth instructions responsive to determining the most recently modified entry, for logging the least recently modified entry in a record that defines the conflict that has been resolved, wherein the replacing and logging are performed by the first data processing system when it is determined that the second entry is the most recently modified entry; and
are performed by the second data processing system when it is determined that the first entry is the most recently modified entry.
-
Specification