IP Library Granted Patent US 10,606,863
Granted Patent B2
US 10,606,863 · App. 15/459,507 · Granted Mar 31, 2020

Monotonic transactions in a multi-master database with loosely coupled nodes

Inventors: Ronald J. Barber (San Jose, CA); Ronen Grosman (Thornhill, CA); Mir Hamid Pirahesh (San Jose, CA); Vijayshankar Raman (Sunnyvale, CA); Adam J. Storm (Toronto, CA)
Assignee: International Business Machines Corporation
G06F16/273G06F16/283
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,606,863
App. No.
15/459,507
Granted
Mar 31, 2020
Kind
B2
Abstract

One embodiment provides for monotonic transactions in a multi-master database with loosely coupled nodes including performing, by a processor, a write transaction protocol including: a client device issuing write transactions at any of the nodes, recording a write transaction locally at a node that issues a write transaction and asynchronously replicating the write transaction to at least one other node, and waiting for reception of an acknowledgment from at least a quorum of the nodes before returning a response to the client device. The quorum is any set of the nodes that includes a special node and at least one other node.

Claims (67)

1. A method for monotonic transactions in a multi-master database with a plurality of nodes that are loosely coupled, the method comprising:

electing, by a processor, a special node from the plurality of nodes based on a consensus protocol; and

performing, by the processor, a write transaction protocol including:

a client device issuing a write transaction at any one particular node of the plurality of nodes;

recording the write transaction locally at the one particular node of the plurality of nodes and asynchronously replicating the write transaction to at least one other node of the plurality of nodes; and

waiting for reception of an acknowledgment from at least a write quorum of the plurality of nodes before returning a response to the client device, wherein the write quorum is any set of the plurality of nodes that includes the special node and at least one other node, and after a commit transaction for storing data from the write transaction to the multi-master database, an initiator node of the plurality of nodes waits to receive an acknowledgement for the commit transaction without ever timing out, and waits for replication of a transaction log to the set of nodes of the write quorum before returning a success result notification for the commit transaction for providing data consistency and visibility of the write transaction for the plurality of nodes.

2. The method of claim 1 , wherein the write quorum and the read quorum each further includes a number of other nodes of the plurality of that are selected based on a durability requirement.

3. The method of claim 1 , wherein upon determining the client device timed out during waiting for receiving an acknowledgment from the multi-master database, the client device obtains status of the write transaction by issuing at least one read transaction.

4. The method of claim 3 , further comprising:

upon determining timeout by the client device of the at least one read transaction, repeating, by the client device, the at least one read transaction.

5. The method of claim 1 , further comprising:

performing, by the processor, a read transaction protocol including:

issuing read transactions at any one of the plurality of nodes;

attempting to return rows that are known to be replicated by at least a read quorum of the plurality of nodes; and

for timing-out of the attempting to return rows known to be replicated by at least the read quorum of the plurality of nodes based on the special-node being non-responsive:

selecting a new special-node from the plurality of nodes; and

repeating attempting to return rows that are known to be replicated by at least the read quorum of the plurality of nodes.

6. The method of claim 5 , further comprising:

assigning weights to the plurality of nodes including the special node, wherein a weight assigned to the special-node exceeds weights assigned to remaining nodes of the plurality of nodes, write quorum voting is based on a first sum of voting nodes weights being equal to or greater than a write quorum threshold, and read quorum voting is based on a second sum of voting nodes weights being equal to or greater than a read quorum threshold.

7. The method of claim 5 , wherein the selecting of the new special-node is performed by the processor upon a transaction failure or non-responsiveness of the special node.

8. A computer program product for monotonic transactions in a multi-master database with a plurality of nodes that are loosely coupled, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to:

elect, by the processor, a special node from the plurality of nodes based on a consensus protocol; and

perform, by the processor, a write transaction protocol including:

a client device issuing a write transaction at any one particular node of the plurality of nodes;

recording the write transaction locally at the one particular node of the plurality of nodes and asynchronously replicating the write transaction to at least one other node of the plurality of nodes; and

waiting for reception of an acknowledgment from at least a write quorum of the plurality of nodes before returning a response to the client device, wherein the write quorum is any set of the plurality of nodes that includes the special node and at least one other node, and after a commit transaction for storing data from the write transaction to the multi-master database, an initiator node of the plurality of nodes waits to receive an acknowledgement for the commit transaction without ever timing out and waits for replication of a transaction log to the set of nodes of the write quorum before returning a success result notification for the commit transaction for providing data consistency and visibility of the write transaction for the plurality of nodes.

9. The computer program product of claim 8 , wherein upon determining the client device timed out during waiting for receiving an acknowledgment from the multi-master database, the client device obtains status of the write transaction by issuing at least one read transaction.

10. The computer program product of claim 8 , wherein the write quorum and the read quorum each further includes a number of other nodes of the plurality of nodes that are selected based on a durability requirement.

11. The computer program product of claim 8 , further comprising program instructions executable by the processor to cause the processor to:

perform, by the processor, a read transaction protocol including further program instructions executable by the processor to cause the processor to:

issue read transactions at any one of the plurality of nodes;

attempt to return rows that are known to be replicated by at least a read quorum of the plurality of nodes; and

for timing out of the attempting to return rows known to be replicated by at least the read quorum of the plurality of nodes based on the special-node being non-responsive:

select a new special-node from the plurality of nodes; and

repeat attempting to return rows that are known to be replicated by at least the read quorum of the plurality of nodes.

12. The computer program product of claim 11 , wherein the selecting of the new special-node is performed by the processor upon a transaction failure or non-responsiveness of the special node.

13. The computer program product of claim 11 , further comprising:

upon determining timeout of the at least one read transaction, repeating, by the client device, the at least one read transaction.

14. The computer program product of claim 11 , wherein selecting of the new special-node is performed by the processor upon a transaction failure or non-responsiveness of the special node.

15. The computer program product of claim 11 , further comprising program instructions executable by the processor to cause the processor to:

assign, by the processor, weights to the plurality of nodes including the special node,

wherein a weight assigned to the special-node exceeds weights assigned to remaining nodes of the plurality of nodes, and write quorum voting is based on a first sum of voting nodes weights being equal to or greater than a write quorum threshold, and read quorum voting is based on a second sum of voting nodes weights being equal to or greater than a read quorum threshold.

16. An apparatus comprising:

a memory configured to store instructions; and

a processor configured to execute the instructions to:

elect a special node from a plurality of nodes that are loosely coupled in a multi-master database based on a consensus protocol; and

perform a write transaction protocol including:

a client device issuing a write transaction at any one particular node of the plurality of nodes;

recording the write transaction locally at the one particular node of the plurality of nodes and asynchronously replicating the write transaction to at least one other node of the plurality of nodes;

waiting for reception of an acknowledgment from at least a write quorum of the plurality of nodes before returning a response to the client device, wherein the write quorum is any set of the plurality of nodes that includes the special node and at least one other node; and

after a commit transaction for storing data from the write transaction to the multi-master database, waiting by an initiator node of the plurality of nodes to receive an acknowledgement for the commit transaction, without ever timing out, and waiting for replication of a transaction log to the set of nodes of the write quorum before returning a success result notification for the commit transaction for providing data consistency and visibility of the write transaction for the plurality of nodes.

17. The apparatus of claim 16 , wherein:

upon determining the client device timed out during waiting for receiving an acknowledgment from the multi-master database, the client device obtains status of the write transaction by issuing at least one read transaction.

18. The apparatus of claim 17 , wherein:

upon determining timeout of the at least one read transaction, repeating, by the client device, the at least one read transaction.

19. The apparatus of claim 16 , wherein the processor is further configured to:

perform a read transaction protocol including:

issue read transactions at any one of the nodes of the plurality of nodes;

attempt to return rows that are known to be replicated by at least a read quorum of the plurality of nodes; and

for timing out of the attempting to return rows known to be replicated by at least the read quorum of the plurality of nodes based on the special-node being non-responsive:

select a new special-node; and

repeat attempting to return rows that are known to be replicated by at least the read quorum of the plurality of nodes.

20. The apparatus of claim 19 , wherein:

selection of the new special-node is performed by the processor upon a transaction failure or non-responsiveness of the special node; and

the write quorum and the read quorum each further includes a number of other nodes of the plurality of nodes that are selected based on a durability requirement.

21. The apparatus of claim 19 , wherein the processor is further configured to:

assign weights to the plurality of nodes including the special node, wherein a weight assigned to the special-node exceeds weights assigned to remaining nodes of the plurality of nodes, and write quorum voting is based on a first sum of voting nodes weights being equal to or greater than a write quorum threshold, and read quorum voting is based on a second sum of voting nodes weights being equal to or greater than a read quorum threshold.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 15, 2017
From: BARBER, RONALD J.; GROSMAN, RONEN; PIRAHESH, MIR HAMID; RAMAN, VIJAYSHANKAR; STORM, ADAM J.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 041586/0199 →
Continuity (1)
Related Publication 20180268044A1 · Sep 20, 2018