Performing 2-phase commit with presumed prepare
First Claim
1. A method of providing atomicity for transactions executing on a database system, the method comprising the steps of:
- a coordinating database system receiving a request to begin a transaction;
said coordinating database system transmitting a first request specifying a first set of modifications to data in a first database as part of said transaction;
said coordinating database system transmitting a second request specifying a second set of modifications to data in a second database system as part of said transaction;
said coordinating database system receiving log tracking data that indicates which modifications on said first database system and said second database system are recorded in log records stored to non-volatile storage; and
said coordinating database system determining whether said log tracking data indicates that said first set of modifications are recorded in log records stored in non-volatile storage.
1 Assignment
0 Petitions
Accused Products
Abstract
A mechanism for performing a two-phase commit is provided. The mechanisms perform a two-phase commit in a manner that reduces the number of messages transmitted between a coordinating database system and the participating database systems, and the number of log flushes performed to complete a two-phase commit. To determine whether a particular participating database system is prepared to commit, the coordinating database system first examines external log tracking data that resides on the coordinating database system. External log tracking data, which indicates various states of logs on other database systems, is used to determine whether or not a particular participating database system is prepared to commit.
32 Citations
6 Claims
-
1. A method of providing atomicity for transactions executing on a database system, the method comprising the steps of:
-
a coordinating database system receiving a request to begin a transaction;
said coordinating database system transmitting a first request specifying a first set of modifications to data in a first database as part of said transaction;
said coordinating database system transmitting a second request specifying a second set of modifications to data in a second database system as part of said transaction;
said coordinating database system receiving log tracking data that indicates which modifications on said first database system and said second database system are recorded in log records stored to non-volatile storage; and
said coordinating database system determining whether said log tracking data indicates that said first set of modifications are recorded in log records stored in non-volatile storage. - View Dependent Claims (2)
if said log tracking data does not indicate that said first set of modifications are recorded in log records stored in non-volatile storage, then said coordinating database system transmitting a prepare request for said transaction to said first database system;
said coordinating database system receiving a message from said first database system indicating that said first database system is prepared to commit said transaction;
said coordinating database system determining whether said log tracking data indicates that said second set of modifications are recorded in log records stored in a non-volatile storage device; and
in response to (1) receiving said message from said first database system, and (2) determining that said log tracking data indicates that said second set of modifications are recorded in log records stored in non-volatile storage device, said first database system committing said transaction on said first database system.
-
-
3. A computer-readable medium carrying one or more sequences of one or more instructions for providing atomicity for transactions executing on a database system, the one or more sequences of one or more instructions including instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of:
-
a coordinating database system receiving a request to begin a transaction;
said coordinating database system transmitting a first request specifying a first set of modifications to data in a first database as part of said transaction;
said coordinating database system transmitting a second request specifying a second set of modifications to data in a second database system as part of said transaction;
said coordinating database system receiving log tracking data that indicates which modifications on said first database system and said second database system are recorded in log records stored to non-volatile storage; and
said coordinating database system determining whether said log tracking data indicates that said first set of modifications are recorded in log records stored in non-volatile storage. - View Dependent Claims (4)
if said log tracking data does not indicate that said first set of modifications are recorded in log records stored in non-volatile storage, then said coordinating database system transmitting a prepare request for said transaction to said first database system;
said coordinating database system receiving a message from said first database system indicating that said first database system is prepared to commit said transaction;
said coordinating database system determining whether said log tracking data indicates that said second set of modifications are recorded in log records stored in a non-volatile storage device; and
in response to (1) receiving said message from said first database system, and (2) determining that said log tracking data indicates that said second set of modifications are recorded in log records stored in non-volatile storage device, said first database system committing said transaction on said first database system.
-
-
5. A distributed database system comprising:
-
a coordinating database system configured to receive a request to begin a transaction;
said coordinating database system configured to transmit a first request specifying a first set of modifications to data in a first database as part of said transaction;
said coordinating database system configured to transmit a second request specifying a second set of modifications to data in a second database system as part of said transaction;
said coordinating database system configured to receive log tracking data that indicates which modifications on said first database system and said second database system are recorded in log records stored to nonvolatile storage; and
said coordinating database system configured to determine whether said log tracking data indicates that said first set of modifications are recorded in log records stored in non-volatile storage. - View Dependent Claims (6)
said coordinating database system is configured to transmit a prepare request for said transaction to said first database system if said log tracking data does not indicate that said first set of modifications are recorded in log records stored in non-volatile storage;
said coordinating database system is configured to receive a message from said first database system indicating that said first database system is prepared to commit said transaction;
said coordinating database system is configured to determine whether said log tracking data indicates that said second set of modifications are recorded in log records stored in a non-volatile storage device; and
said first database system is configured to commit said transaction on said first database system in response to (1) receiving said message from said first database system, and (2) determining that said log tracking data indicates that said second set of modifications are recorded in log records stored in non-volatile storage device.
-
Specification