Commitment of transactions in a distributed system
Abstract
A computer program product and system for committing transactions in a distributed system are provided. The method, computer program product, and system provide for receiving a request from a client to commit a transaction at a coordinator node in the distributed system, tracking a tail log sequence number for every other node in the distributed system, determining a max log sequence number associated with the transaction for each participant node in the distributed system, and committing the transaction at the coordinator node when the tail log sequence number for each participant node is greater than or equal to the max log sequence number associated with the transaction at the respective participant node.
Claims
exact text as granted — not AI-modified1 . A computer program product on a computer-readable medium containing a plurality of executable program instructions for committing transactions in a distributed system, the instructions when executed perform to:
receive a request from a client to commit a transaction at a coordinator node in the distributed system, the distributed system comprising one or more participant nodes; track a tail log sequence number for each of all other nodes in the distributed system, each tail log sequence number being associated with a last transaction log record flushed by a respective node, wherein at least one node of the all other nodes is a participant node; determine a max log sequence number associated with the transaction for each of one or more participant nodes, each max log sequence number corresponding to a highest transaction log record required for the transaction at the respective participant node; and commit the transaction at the coordinator node when the tail log sequence number for each of the one or more participant nodes is greater than or equal to the max log sequence number associated with the transaction at the respective participant node.
2 . The product of claim 1 , wherein
track the tail log sequence number for each of the all other nodes in the distributed system comprises:
maintain a first array comprising an entry for each of the all other nodes in the distributed system, each entry being operably configured to store the tail log sequence number for a respective other node, and
update the first array when a new tail log sequence number is piggybacked on a message from one of the all other nodes;
determine the max log sequence number associated with the transaction for each of the one or more participant nodes comprises:
create a second array for the transaction, the second array comprising an entry for each of the one or more participant nodes, wherein each entry is operable to store the max log sequence number associated with the transaction for the respective participant node, and
update the second array when the max log sequence number associated with the transaction is piggybacked on a response from one node of the one or more participant nodes; and
commit the transaction at the coordinator node comprises:
compare the second array to the first array to determine whether each of the one or more participant nodes has flushed the highest transaction log record required for the transaction at the respective participant node,
write a commit log record for the transaction at the coordinator node when each of the one or more participant nodes has flushed the highest transaction log record required for the transaction at the respective participant node,
schedule a commit request to be sent to each of the one or more participant nodes along with another message already scheduled to be sent to the respective participant node when each of the one or more participant nodes has flushed the highest transaction log record required for the transaction at the respective participant node, and
return a successful commit message to the client when each of the one or more participant nodes has flushed the highest transaction log record required for the transaction at the respective participant node.
3 . The product of claim 2 , wherein the new tail log sequence number is not the most current transaction log record flushed by the node and the message comprises one or more responses, one or more requests, or at least one response and at least one request.
4 . The product of claim 1 , wherein the instructions when executed on the computer further causes the computer to:
reclaim a log space at the coordinator node assigned to retain information about the state of the transaction when a response is received from each of the one or more participant nodes specifying that the transaction has been committed at the respective participant node, wherein each response is piggybacked on an unrelated message being sent from the respective participant node to the coordinator node.
5 . The product of claim 1 , wherein a first agent on the coordinator node handles execution of the transaction and a second agent on the coordinator node handles commitment of the transaction.
6 . The product of claim 1 , wherein the instructions when executed on the computer further causes the computer to:
send a message to at least one participant node to flush one or more transaction log records at the at least one participant node when the tail log sequence number for the at least one participant node is less than the max log sequence number associated with the transaction at the at least one participant node.
7 . A distributed data processing system having a plurality of system nodes each of the plurality of system nodes being a respective data processing system where at least one of the plurality of system nodes is a client system at a coordinator node and each data processing system includes a processor coupled to one or more memory elements through a respective system bus of the data processing system and at least one input and at least one output device, the system comprising:
a plurality of databases; and a plurality of nodes connected to one another, each of the plurality nodes being coupled to one or more of the plurality of databases, wherein at least one of the plurality of nodes is operable to:
receive a request from a client to commit a transaction at the at least one node, the at least one node being a coordinator node for the transaction, wherein one or more of the plurality of nodes are participant nodes;
track a tail log sequence number for each of all other nodes in the distributed system, each tail log sequence number being associated with a last transaction log record flushed by a respective node, wherein at least one node of the all other nodes is a participant node;
determine a max log sequence number associated with the transaction for each of one or more participant nodes, each max log sequence number corresponding to a highest transaction log record required for the transaction at the respective participant node; and
commit the transaction at the coordinator node when the tail log sequence number for each of the one or more participant nodes is greater than or equal to the max log sequence number associated with the transaction at the respective participant node.
8 . The system of claim 7 , wherein
track the tail log sequence number for each of the all other nodes in the distributed system comprises:
maintain a first array comprising an entry for each of the all other nodes in the distributed system, each entry being operably configured to store the tail log sequence number for the respective other node, and
update the first array when a new tail log sequence number is piggybacked on a message from one of the all other nodes;
determine the max log sequence number associated with the transaction for each node of the one or more participant nodes comprises:
create a second array for the transaction, the second array comprising an entry for each node of the one or more participant nodes, wherein each entry is operable to store the max log sequence number associated with the transaction for the respective participant node, and
update the second array when the max log sequence number associated with the transaction is piggybacked on a response from one of the one or more participant nodes; and
commit the transaction at the coordinator node comprises:
compare the second array to the first array to determine whether each of the one or more participant nodes has flushed the highest transaction log record required for the transaction at the respective participant node,
write a commit log record for the transaction at the coordinator node when each of the one or more participant nodes has flushed the highest transaction log record required for the transaction at the respective participant node,
schedule a commit request to be sent to each of the one or more participant nodes along with another message already scheduled to be sent to the respective participant node when each of the one or more participant nodes has flushed the highest transaction log record required for the transaction at the respective participant node, and
return a successful commit message to the client when each of the one or more participant nodes has flushed the highest transaction log record required for the transaction at the respective participant node.
9 . The system of claim 8 , wherein the new tail log sequence number is not the most current transaction log record flushed by the node and the message comprises one or more responses, one or more requests, or at least one response and at least one request.
10 . The system of claim 8 , wherein the coordinator node is further operably configured to:
reclaim a log space at the coordinator node assigned to retain information about the state of the transaction when a response is received from each node of the one or more participant nodes specifying that the transaction has been committed at the respective participant node, wherein each response is piggybacked on an unrelated message being sent from the respective participant node to the coordinator node.
11 . The distributed system of claim 7 , wherein a first agent on the coordinator node handles execution of the transaction and a second agent on the coordinator node handles commitment of the transaction and the coordinator node is further operable to:
send a message to at least one participant node to flush one or more transaction log records at the at least one participant node when the tail log sequence number for the at least one participant node is less than the max log sequence number associated with the transaction at the at least one participant node.
12 . The product of claim 1 , wherein, for each tail log sequence number, the last transaction record flushed by the respective node and being associated therewith is not an actual last transaction log record flushed by the respective node.
13 . The product of claim 12 , wherein the last transaction record flushed is an earlier transaction log record.
14 . The system of claim 7 , wherein, for each tail log sequence number, the last transaction record flushed by the respective node and being associated therewith is not an actual last transaction log record flushed by the respective node.
15 . The system of claim 14 , wherein the last transaction record flushed is an earlier transaction log record.Join the waitlist — get patent alerts
Track US2008235245A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.