Database computer system with application recovery and recovery log sequence numbers to optimize recovery
First Claim
1. In a database computer system that tracks a recovery log sequence number for a corresponding object to identify a particular log record at which to begin replay to recover the object to a particular state following a system crash, a computer-implemented method comprising the following steps:
- incrementally logging in a log record the recovery log sequence number; and
replaying, during recovery from a system crash, operations referenced in log records identified by the recovery log sequence number.
3 Assignments
0 Petitions
Accused Products
Abstract
This invention concerns a database computer system and method for making applications recoverable from system crashes. The application state (i.e., address space) is treated as a single object which can be atomically flushed in a manner akin to flushing individual pages in database recovery techniques. To enable this monolithic treatment of the application, executions performed by the application are mapped to logical loggable operations which can be posted to the stable log. Any modifications to the application state are accumulated and the application state is periodically flushed to stable storage using an atomic procedure. The application recovery integrates with database recovery, and effectively eliminates or at least substantially reduces the need for check pointing applications. In addition, optimization techniques are described to make the read, write, and recovery phases more efficient.
208 Citations
27 Claims
-
1. In a database computer system that tracks a recovery log sequence number for a corresponding object to identify a particular log record at which to begin replay to recover the object to a particular state following a system crash, a computer-implemented method comprising the following steps:
-
incrementally logging in a log record the recovery log sequence number; and replaying, during recovery from a system crash, operations referenced in log records identified by the recovery log sequence number. - View Dependent Claims (2, 3)
-
-
4. In a database computer system that tracks a recovery log sequence number for a corresponding object to identify a particular log record at which to begin replay to recover the object to a particular state following a system crash, a computer-implemented method comprising the following steps:
-
advancing the recovery log sequence number to a later log record subsequent to the particular log record, the later log record reflecting the object at a state in which computer application operations that write the object state are installed in the non-volatile memory, said advancing step advancing the recovery log sequence number regardless of whether the corresponding object is flushed to the non-volatile memory; and replaying, during recovery from a system crash, operations referenced in log records that start at the later log record identified by the recovery log sequence number. - View Dependent Claims (5, 6, 7, 8)
-
-
9. In a database computer system that maintains a stable log having log records referencing computer application operations and that tracks a recovery log sequence number for a corresponding object to identify a particular log record in the stable log at which to begin replaying associated computer application operations to recover the object to a particular state following a system crash , a computer-implemented method comprising the following steps:
-
advancing the recovery log sequence number to a later log record subsequent to the particular log record, the later log record reflecting the object at a state in which the computer application operations that have written the object state are installed in the non-volatile memory, said advancing step advancing the recovery log sequence number regardless of whether the object is flushed to the non-volatile memory; and in the event of a system crash, analyzing the stable log to locate the recovery log sequence number and redoing operations referenced in the stable log beginning at the later log record identified by the recovery log sequence number. - View Dependent Claims (10, 11, 12, 13, 14, 16, 17, 18, 19)
-
-
15. In a database computer system having a non-volatile memory, a volatile main memory, and an application object which executes from the main memory, a computer-implemented method comprising the following steps:
-
initiating the application object; executing the application object; terminating the application object without flushing the application object to non-volatile memory; logging logical operations associated with the initiating, executing, and terminating steps; assigning log sequence numbers to the logged operations; and setting a recovery log sequence number equal to the log sequence number of the operation associated with the terminating of the application object so that during recovery, the operations associated with the application object preceding the termination operation are not replayed; and commencing replay of the logged operations, following a system crash at the operation having the log sequence number identified by the recovery log sequence number.
-
-
20. In a database computer system having a non-volatile memory, a volatile main memory, and an application object which executes from the main memory, and wherein the non-volatile memory includes a stable log, a computer-implemented method comprising the following steps:
-
executing the application object to perform operations which read data from, and write data to, a data object; posting to the stable log a log record for each operation involving the reading or writing of data, the log record containing a reference to either the application object or the data object to identify that referenced object as a source for the data that is read from or written to; assigning a log sequence number (LSN) to each log record; defining a recovery log sequence number for the application object (rLSNA) to identify a first log record associated with the application object and a recovery log sequence number for the data object (rLSNO) to identify a second log record associated with the data object, the rLSNA and rLSNO being used to help determine at which point in the stable log to begin replaying the operations during recovery from a system crash to restore the application and data objects to their operation states just prior to the crash; occasionally flushing the application object to non-volatile memory to install the operations performed by the application object, said flushing step further resulting in the installation of operations that wrote data to the data object; advancing the rLSNA to identify a third log record subsequent to the first log record; advancing the rLSNO to identify a fourth log record subsequent to the second log record, the fourth log record reflecting the data object at a state in which the operations that wrote the object state are installed in the non-volatile memory; analyzing the stable log, during recovery from a system crash, to find the rLSNA and the rLSNO ; determining, during the recovery, a minimum recovery log sequence number rLSNmin that is the earlier of the rLSNA and the rLSNO ; and applying a redo test to each log record in the stable log, starting at the log record identified by the rLSNmin, by comparing the LSN of the log record pertaining to an object to the rLSNO for that object, the redo test comprising; (a) if the LSN≦
rLSNO, not redoing the operation in the log record; and(b) if the LSN>
rLSNO, redoing the operation in the log record. - View Dependent Claims (21, 22, 23, 24)
-
-
25. A database computer system comprising:
-
a volatile main memory; a non-volatile memory that persists across a system crash; a processing unit coupled to the main memory and the non-volatile memory; an application object stored in the volatile main memory and executable on the processing unit; a resource manager which interacts with the application object to mediate communication between the application object and a data object so that, during a write operation, the resource manager writes data from the application object to the data object; the resource manager being configured to log, in a log record on the non-volatile memory, operations performed by the application object and assign a log sequence number (LSN) to each log record; the resource manager further defining a recovery log sequence number for the application object (rLSNA) to identify a first log record associated with the application object and a recovery log sequence number for the data object (rLSNO) to identify a second log record associated with the data object, the rLSNA and rLSNO being used to help determine at which point in the stable log to begin replaying the operations during recovery from a system crash to restore the application and data objects; the resource manager including a cache manager to occasionally flush the application object to non-volatile memory to install the operations performed by the application object, including operations that wrote data to the data object, whereupon flushing the application object, the cache manager advances both the rLSNA and the rLSNO to subsequent log records that reflect the application and data objects at states in which the operations that wrote their states are installed in the non-volatile memory; the resource manager further including a recovery manager that is invoked following a system crash, the recovery manager analyzing the stable log to find the rLSNA and the rLSNO and determining a minimum recovery log sequence number rLSNmin that is the earlier of the rLSNA and the rLSNO, the recovery manager applying a redo test to each log record in the stable log, starting at the log record having identified by the rLSNmin, by comparing the LSN of the log record pertaining to an object to the rLSNO for that object, the redo test comprising; (a) if the LSN≦
rLSNO, the recovery manager doe not redo the operation in the log record, and(b) if the LSN>
rLSNO, the recovery manager redoes the operation in the log record.
-
-
26. For use on a database computer system having a non-volatile memory, a volatile main memory, and a processor, a resource manager comprising:
-
a cache manager executable on the processor to track objects active in the main memory and to manage flushing of objects from the main memory to the non-volatile memory, the cache manager being configured to maintain a recovery log sequence number (rLSN) for each corresponding object to identify a particular log record at which to begin replay to recover the corresponding object to a particular state following a system crash, the cache manager advancing the rLSN for the corresponding object to a subsequent log record that reflects the corresponding object at a state in which computer application operations that wrote that object state are installed in the non-volatile memory, regardless of whether the corresponding object is flushed to the non-volatile memory; and a recovery manager that is invoked following a system crash, the recovery manager replaying, during recovery from the system crash, operations referenced in log records that start at the subsequent log record identified by the rLSN. - View Dependent Claims (27)
-
Specification