Method for transaction within a distributed database
First Claim
1. A method of performing a transaction that affects a plurality of nodes within a system of nodes in which information belonging to a distributed data base is stored, wherein said information is divided into tables and said transaction originates from a transaction coordinator, wherein said transaction affects at least one group of parts of at least one first table of said number of tables, wherein said group includes at least a first and a second part and possibly one or more further parts, wherein said first table part is stored in a first node and said second table part is stored in a second node that is separate from said first node, wherein possible other table parts in said group are stored in intermediate nodes comprised of further nodes that are separate from each other and from said first and said second node, and wherein said transaction is a two-safe transaction, characterized by opening said transaction with a first phase in which:
- said transaction coordinator sends a “
prepare”
-message, by which is meant a request asking the first node to prepare for said transaction;
when said first node is able to undertake said transaction, said first node sends a prepare request to said second node either directly or via one or more intermediate nodes, or when said first node is unable to carry out said transaction, said first node sends an “
unprepared”
-message to said second node, either directly or via one or more intermediate nodes;
when said second node is able to undertake said transaction, said second node sends a “
prepared”
-message directly to said transaction coordinator, i.e. a message indicating that all affected nodes are prepared to undertake said transaction;
or when said second node is unable to carry out said transaction or when said second node has received an “
unprepared”
-message, said second node sends an “
unprepared”
-message directly to said transaction coordinator, which concludes said first phase, wherein said first phase is followed by a second phase in which;
said transaction coordinator sends directly to said second node a message regarding measures to be carried out;
said second node then sends said message regarding said measures to said first node, either directly or via one or more intermediate nodes; and
in which said first node then sends a concluding message to said transaction coordinator;
therewith concluding said second phase, where said message regarding said measures is a “
commit”
-message, i.e. a message to carry out the measures in accordance with said transaction, and said concluding message is a “
committed”
-message i.e. a message stating that the measures have been carried out in accordance with the transaction, provided that the first phase is concluded with a “
prepared”
-message, or when said message regarding said measures is an “
abort”
-message, i.e. a message to abort said transaction and said concluding message is an “
aborted”
-message, i.e. the transaction is aborted, when said first phase is concluded with an “
unprepared”
-message, wherein said transaction affects further groups of table parts where respective groups include parts belonging to said first table or parts belonging to some other table within said data base but separate from said first table;
wherein said table parts are stored in first and second nodes and possibly in one or more intermediate nodes, each being separate from the other within respective groups of parts;
wherein said first phase is opened with said preparatory request from said transaction coordinator to respective first nodes and is concluded with a “
prepared”
-message or an “
unprepared”
-message from respective second nodes to said transaction coordinator;
wherein said second phase is opened with said message regarding measures to be carried out from said transaction coordinator to respective second nodes and concluded with said concluding message from respective first nodes to said transaction coordinator, said message regarding measures to be carried out is a “
commit”
-message, i.e. a message to carry out measures in accordance with said transaction, and said concluding message is a “
committed”
message, i.e. a message stating that the measures have been carried out in accordance with the transaction, when said first phase is concluded with a “
prepared”
-message from all second nodes, or when said message regarding said measures is an “
abort”
-message, i.e. a message to abort said transaction and said concluding message is a transaction aborted message, when said first phase is concluded with an “
unprepared”
message from any second node.
4 Assignments
0 Petitions
Accused Products
Abstract
The present invention relates to a method of performing a transaction that affects several nodes within a system of nodes in which information belonging to a distributed data-base is stored. The transaction originates from a transaction coordinator (1) and affects at least one group of nodes which comprises a first node (n1), a second node (n2) separate from the first node (n1) and possible intermediate nodes (n3) which comprise further nodes that are separated from one another and from the first and the second node. The transaction is opened with a first phase in which the transaction coordinator sends a “prepare ”-message (a) to the first node (n1), the first node then sends a request (b) for preparation or an “unprepared”-message to the second node (n2) either directly or via one or more intermediate nodes (n3), whereafter the second node sends a “prepared”-message or an “unprepared”-message (c) directly to the transaction coordinator (1), which concludes the first phase. In a second phase, the transaction coordinator (1) sends to the second node (n2) a message (d) regarding measures to be taken and the second node then sends the message (e) regarding measures to be taken to the first node (n1), either directly or via one or more intermediate nodes. The first node then sends a concluding message (f) to the transaction coordinator (1), which concludes the second phase. The message (d) regarding measures to be taken is either a “commit”-message or an “abort”-message and the concluding message (f) is either a “committed”-message or an “aborted”-message, depending on whether the first phase was concluded with “prepared” or “unprepared”.
84 Citations
30 Claims
-
1. A method of performing a transaction that affects a plurality of nodes within a system of nodes in which information belonging to a distributed data base is stored, wherein said information is divided into tables and said transaction originates from a transaction coordinator, wherein said transaction affects at least one group of parts of at least one first table of said number of tables, wherein said group includes at least a first and a second part and possibly one or more further parts, wherein said first table part is stored in a first node and said second table part is stored in a second node that is separate from said first node, wherein possible other table parts in said group are stored in intermediate nodes comprised of further nodes that are separate from each other and from said first and said second node, and wherein said transaction is a two-safe transaction, characterized by opening said transaction with a first phase in which:
-
said transaction coordinator sends a “
prepare”
-message, by which is meant a request asking the first node to prepare for said transaction;
when said first node is able to undertake said transaction, said first node sends a prepare request to said second node either directly or via one or more intermediate nodes, or when said first node is unable to carry out said transaction, said first node sends an “
unprepared”
-message to said second node, either directly or via one or more intermediate nodes;
when said second node is able to undertake said transaction, said second node sends a “
prepared”
-message directly to said transaction coordinator, i.e. a message indicating that all affected nodes are prepared to undertake said transaction;
orwhen said second node is unable to carry out said transaction or when said second node has received an “
unprepared”
-message, said second node sends an “
unprepared”
-message directly to said transaction coordinator,which concludes said first phase, wherein said first phase is followed by a second phase in which;
said transaction coordinator sends directly to said second node a message regarding measures to be carried out;
said second node then sends said message regarding said measures to said first node, either directly or via one or more intermediate nodes; and
in whichsaid first node then sends a concluding message to said transaction coordinator;
therewith concluding said second phase, where said message regarding said measures is a “
commit”
-message, i.e. a message to carry out the measures in accordance with said transaction, and said concluding message is a “
committed”
-message i.e. a message stating that the measures have been carried out in accordance with the transaction, provided that the first phase is concluded with a “
prepared”
-message, or when said message regarding said measures is an “
abort”
-message, i.e. a message to abort said transaction and said concluding message is an “
aborted”
-message, i.e. the transaction is aborted, when said first phase is concluded with an “
unprepared”
-message,wherein said transaction affects further groups of table parts where respective groups include parts belonging to said first table or parts belonging to some other table within said data base but separate from said first table;
wherein said table parts are stored in first and second nodes and possibly in one or more intermediate nodes, each being separate from the other within respective groups of parts;
wherein said first phase is opened with said preparatory request from said transaction coordinator to respective first nodes and is concluded with a “
prepared”
-message or an “
unprepared”
-message from respective second nodes to said transaction coordinator;
wherein said second phase is opened with said message regarding measures to be carried out from said transaction coordinator to respective second nodes and concluded with said concluding message from respective first nodes to said transaction coordinator, said message regarding measures to be carried out is a “
commit”
-message, i.e. a message to carry out measures in accordance with said transaction, and said concluding message is a “
committed”
message, i.e. a message stating that the measures have been carried out in accordance with the transaction, when said first phase is concluded with a “
prepared”
-message from all second nodes, or when said message regarding said measures is an “
abort”
-message, i.e. a message to abort said transaction and said concluding message is a transaction aborted message, when said first phase is concluded with an “
unprepared”
message from any second node.- View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27)
-
-
28. A method of performing a transaction that affects a plurality of nodes within a system of nodes in which information belonging to a distributed data base is stored, wherein said information is divided into tables and said transaction originates from a transaction coordinator, wherein said transaction affects at least one group of parts of at least one first table of said number of tables, wherein said group includes at least a first and a second part and possibly one or more further parts, wherein said first table part is stored in a first node and said second table part is stored in a second node that is separate from said first node, wherein possible other table parts in said group are stored in intermediate nodes comprised of further nodes that are separate from each other and from said first and said second node, and wherein said transaction is a two-safe transaction, characterized by opening said transaction with a first phase in which:
-
said transaction coordinator sends a “
prepare”
-message, by which is meant a request asking the first node to prepare for said transaction;
when said first node is able to undertake said transaction, said first node sends a prepare request to said second node either directly or via one or more intermediate nodes, or when said first node is unable to carry out said transaction, said first node sends an “
unprepared”
-message to said second node, either directly or via one or more intermediate nodes;
when said second node is able to undertake said transaction, said second node sends a “
prepared”
-message directly to said transaction coordinator, i.e. a message indicating that all affected nodes are prepared to undertake said transaction;
orwhen said second node is unable to carry out said transaction or when said second node has received an “
unprepared”
-message, said second node sends an “
unprepared”
-message directly to said transaction coordinator,which concludes said first phase, wherein said first phase is followed by a second phase in which;
said transaction coordinator sends directly to said second node a message regarding measures to be carried out;
said second node then sends said message regarding said measures to said first node, either directly or via one or more intermediate nodes; and
in whichsaid first node then sends a concluding message to said transaction coordinator;
therewith concluding said second phase, where said message regarding said measures is a “
commit”
-message, i.e. a message to carry out the measures in accordance with said transaction, and said concluding message is a “
committed”
-message, i.e. a message stating that the measures have been carried out in accordance with the transaction, provided that the first phase is concluded with a “
prepared”
-message, or when said message regarding said measures is an “
abort”
-message, i.e. a message to abort said transaction, and said concluding message is an “
aborted”
-message, i.e. the transaction is aborted, when said first phase is concluded with an “
unprepared”
-message,wherein one of said nodes affected by said transaction crashes during the performance of said transaction, characterized in that said transaction coordinator checks all ongoing message transmissions;
the transaction phase that has been halted is re-started from the beginning;
the messages are sent in accordance with said phase but with the exclusion of the crashed node; and
if a node receives an earlier received message, the node ignores said message and forwards the same.- View Dependent Claims (29)
-
-
30. A method of performing a transaction that affects a plurality of nodes within a system of nodes in which information belonging to a distributed data base is stored, wherein said information is divided into tables and said transaction originates from a transaction coordinator, wherein said transaction affects at least one group of parts of at least one first table of said number of tables, wherein said group includes at least a first and a second part and possibly one or more further parts, wherein said first table part is stored in a first node and said second table part is stored in a second node that is separate from said first node, wherein possible other table parts in said group are stored in intermediate nodes comprised of further nodes that are separate from each other and from said first and said second node, and wherein said transaction is a two-safe transaction, characterized by opening said transaction with a first phase in which:
-
said transaction coordinator sends a “
prepare”
-message, by which is meant a request asking the first node to prepare for said transaction;
when said first node is able to undertake said transaction, said first node sends a prepare request to said second node either directly or via one or more intermediate nodes, or when said first node is unable to carry out said transaction, said first node sends an “
unprepared”
-message to said second node, either directly or via one or more intermediate nodes;
when said second node is able to undertake said transaction, said second node sends a “
prepared”
-message directly to said transaction coordinator, i.e. a message indicating that all affected nodes are prepared to undertake said transaction;
orwhen said second node is unable to carry out said transaction or when said second node has received an “
unprepared”
-message, said second node sends an “
unprepared”
-message directly to said transaction coordinator,which concludes said first phase, wherein said first phase is followed by a second phase in which;
said transaction coordinator sends directly to said second node a message regarding measures to be carried out;
said second node then sends said message regarding said measures to said first node, either directly or via one or more intermediate nodes; and
in whichsaid first node then sends a concluding message to said transaction coordinator;
therewith concluding said second phase, where said message regarding said measures is a “
commit”
-message, i.e. a message to carry out the measures in accordance with said transaction, and said concluding message is a “
committed”
-message, i.e. a message stating that the measures have been carried out in accordance with the transaction, provided that the first phase is concluded with a “
prepared”
-message, or when said message regarding said measures is an “
abort”
-message, i.e. a message to abort said transaction, and said concluding message is an “
aborted”
-message, i.e. the transaction is aborted, when said first phase is concluded with an “
unprepared”
-message,wherein the transaction coordinator crashes during the performance of said transaction and wherein a system coordinator is adapted to detect the crash of a node in the system, characterized in that the system coordinator sends a general query to all nodes in said system asking whether or not a node is a participant in a transaction where said crashed node is a transaction coordinator;
a new node is allocated the role of transaction coordinator;
all respective nodes affected by said transaction compile a status report which is sent to the new transaction coordinator, and in that said new transaction coordinator determines on the basis of said status reports whether said transaction shall continue or be aborted.
-
Specification