Systems and methods for reading only durably committed data in a system that otherwise permits lazy commit of transactions
First Claim
1. A computer-implemented method for reading a changed data page from a memory of a computer system, said method comprising:
- making a change to a data page in the memory as a result of a transaction performed by the computer system;
storing data associated with the change in a transaction log buffer in the memory of the computer system, but not immediately flushing the transaction log buffer to a persistent data store;
marking the changed data page in the memory to indicate on the changed data page that the transaction log buffer has yet to be flushed to the persistent data store;
processing a subsequent transaction in which a durable read of at least a portion of the changed data page is to be performed, and before reading the changed data page;
determining whether the changed data page is marked indicating that the transaction log buffer has yet to be flushed to the persistent data store;
if the changed data page is marked indicating that the transaction log buffer has yet to be flushed to the persistent data store, flushing the transaction log buffer to the persistent data store prior to the changed data page being read;
unmarking the changed data page when the transaction log buffer is flushed; and
reading an unmarked data page as part of a read operation that uses data that has been stored in the persistent data store, without first flushing said transaction log buffer.
2 Assignments
0 Petitions
Accused Products
Abstract
A “lazy commit” allows database transactions to be committed faster by not waiting for log records of the transaction to be written to disk. When a system crash occurs during the commit process, transactions may be lost because the log data is not available to recreate the transaction. While lazy commits speed up processing, they also increase the potential for data inconsistency. This invention introduces the concept of “durable reads”—transactions that require isolation from lazy commit transactions and which must be guaranteed to read only durably committed data. When durable read transaction attempts to read data changed by a lazy commit transaction, the system ensures the lazy commit transaction'"'"'s changes are first made durable.
51 Citations
22 Claims
-
1. A computer-implemented method for reading a changed data page from a memory of a computer system, said method comprising:
-
making a change to a data page in the memory as a result of a transaction performed by the computer system; storing data associated with the change in a transaction log buffer in the memory of the computer system, but not immediately flushing the transaction log buffer to a persistent data store; marking the changed data page in the memory to indicate on the changed data page that the transaction log buffer has yet to be flushed to the persistent data store; processing a subsequent transaction in which a durable read of at least a portion of the changed data page is to be performed, and before reading the changed data page; determining whether the changed data page is marked indicating that the transaction log buffer has yet to be flushed to the persistent data store; if the changed data page is marked indicating that the transaction log buffer has yet to be flushed to the persistent data store, flushing the transaction log buffer to the persistent data store prior to the changed data page being read; unmarking the changed data page when the transaction log buffer is flushed; and reading an unmarked data page as part of a read operation that uses data that has been stored in the persistent data store, without first flushing said transaction log buffer. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computer-readable storage medium having computer-readable instructions for reading a changed data page in a memory of a computer system, said computer-readable instructions comprising instructions for:
-
making a change to a data page in the memory as a result of a transaction performed by the computer system; storing data associated with the change in a transaction log buffer in the memory of the computer system, but not immediately flushing the transaction log buffer to a persistent data store; marking the changed data page in the memory to indicate on the changed data page that the transaction log buffer has yet to be flushed to the persistent data store; processing a subsequent transaction in which a durable read of at least a portion of the changed data page is to be performed, and before reading the changed data page; determining whether the changed data page is marked indicating that the transaction log buffer has yet to be flushed to the persistent data store; if the changed data page is marked indicating that the transaction log buffer has yet to be flushed to the persistent data store, flushing the transaction log buffer to the persistent data store prior to the changed data page being read to ensure data consistency in the event of a system interruption; unmarking the changed data page when the transaction log buffer is flushed; and reading an unmarked data page as part of a read operation that uses data that has been stored in the persistent data store, without first flushing said transaction log buffer. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
-
17. A computer system, said computer system comprising:
-
a processing unit; a memory; a persistent data store; a plurality of data pages stored in the memory; and a transaction log buffer stored in the memory wherein when the processing unit changes one of the plurality of data pages while performing a transaction, the processing unit stores data associated with the change in the transaction log buffer, but does not immediately flush the transaction log buffer to the persistent data store, and marks the changed data page to indicate on the changed data page that the transaction log buffer containing said data associated with the change has yet to be flushed to the persistent data store; and wherein when the processing unit thereafter performs a subsequent transaction in which a durable read of at least a portion of the changed data page is to be performed, the processing unit, before reading the changed data page; determines whether the changed data page is marked indicating that the transaction log buffer has yet to be flushed to the persistent data store; if the changed data page is marked indicating that the transaction log buffer has yet to be flushed to the persistent data store, flushes the transaction log to the persistent data store prior to the changed data page being read to ensure data consistency in the event of a system interruption; and unmarks the changed data page when the transaction log buffer is flushed, and wherein the processing unit reads an unmarked data page as part of a read operation that uses data that has been stored in the persistent data store, without first flushing said transaction log buffer. - View Dependent Claims (18, 19, 20, 21, 22)
-
Specification