EP1407359B1

Parallelized redo-only logging and recovery for highly available main memory database systems

Abstract

A parallel logging and recovery scheme for highly available main-memory database systems is presented. A preferred embodiment called parallel redo-only logging ("PROL") combines physical logging and selective replay of redo-only log records. During physical logging, log records are generated with an update sequence number representing the sequence of database update. The log records are replayed selectively during recovery based on the update sequence number. Since the order of replaying log records doesn't matter in physical logging, PROL makes parallel operations possible. Since the physical logging does not depend on the state of the object to which the log records are applied, the present invention also makes it easy to construct a log-based hot standby system.

EP1407359B1, drawing sheet 1
Sheet 1 of 18

Term

Term ended

Expired 16 July 2022, 4.2 years ago.

  1. Priority
  2. Filed
  3. Granted
  4. Expired
  5. Today

26 claims: 3 independent, 23 dependent

  1. 1
    A method of logging a system having a database (100, 200) so that the system can recover the database (100, 200) in case of a system failure, wherein the database (100, 200) resides in main memory, wherein the system processes transactions where a transaction is a set of operations forming a logical unit in an application, the method comprising the steps of :generating log records, each representing update to the database (100, 200) by storing physical image (402) of the update portion;assigning an update sequence number representing the sequence of database updates to each log record;storing the generated log records into one or more log disks (109, 110, 204, 205, 505);checkpointing by storing a backup copy of the database (100, 200) into one or more backup disks (111, 112, 202, 203);reading log records, each having an update sequence number representing the sequence of database updates and a physical image (402) of the updated portion;and selectively replaying the log records based on the update sequence number;characterized in that the system maintains an active transaction table (ATT) (502) for storing active transactions, private log buffers (503) for storing redo and undo transactions, and public log buffers (504) for storing committed redo transactions;wherein the update sequence number is a slot sequence number (SSN) representing the sequence of updates to a given slot (412, 413) of the database (100, 200), and wherein the step of assigning an update sequence number further comprises the step of assigning a page version number (PVN) (415) that is increased by one when a page is formatted with a different slot size;wherein the step of generating log records comprises the steps of: generating redo log records and undo log records in a private log buffer (503);updating the slot (412, 413);and copying the update sequence number of the slot (412, 413) and the PVN (415) of the page into the redo log record and incrementing the update sequence number;wherein the method comprises the further step of reading page version numbers (PVN) (415) each of which was increased by one when a page is formatted with a different slot size;and wherein the step of selectively replaying further comprises the steps of: reading the position of a begin_checkpoint record from a log anchor (113, 210) and marking it as the beginning of the log record;initializing the ATT (502) from an active transaction list stored in the log anchor (113, 210);going backward in the log record from the end until the first commit record is encountered;marking the position as the end of the log record;from the marked log beginning to the marked log end going forward in the log, doing the step further comprising the following steps of: (A) for an updated log record, (i) holding a latch on the page, (ii) if the update record's PVN (405) is larger or equal to the page header's (411) PVN (415), proceeding to the next step, otherwise releasing the latch and ignoring the record;(iii) if the update record's update sequence number (407) is larger than the current update sequence number (417, 418), updating the current update sequence number (417, 418) with the record's update sequence number (407), otherwise, ignoring the current update record;(iv) releasing the latch;(B) for a committed log record, (i) removing a corresponding transaction ID (TID) from the ATT (502), if it exists;(ii) waiting until the back loading completes;and (iii) rolling back the remaining TIDs in the ATT (502).
  2. 17
    A system adapted to perform a method according to any of claims 1 to 16, the system having a database (100, 200) for recovering from a system failure, wherein the system processes transactions where a transaction is a set of operations forming a logical unit in an application, the system comprising:main memory for storing the database (100, 200);log manager (108) for logging updates to the database (100, 200) by generating log records;checkpoint manager (107) for checkpointing;one or more log disks (109, 110, 204, 205, 505) for storing log records representing update to the database (100, 200) by storing the physical image (402) of the update;one or more backup disks (111, 112, 202, 203) for storing a copy of the main memory database (100, 200);log anchor (113, 210) for keeping locations of backup databases and important log records;a recovery manager (106) having a counter for storing an update sequence number for representing the sequence of database updates;characterized in that the database (100, 200) comprises a plurality of slots (412, 413);wherein the system further comprises an active transaction table (ATT) (502) for storing active transactions;one or more private log buffers (503) for storing both redo and undo transaction log records;one or more public log buffers (504) for storing committed redo transaction log records;and wherein the update sequence number is a slot sequence number representing the sequence of updates to a given slot (412, 413) of the database (100, 200).
  3. 23
    A computer-readable storage medium that contains a program for logging up-dates in a system according to any of claims 17 to 22, the system further having a central processing unit (CPU), where the program under the control of a CPU performs the steps of a method according to any of claims 1 to 16.