Home | Previous Page | Next Page   Logging and Log Administration > Checkpoints and Fast Recovery > Checkpoints >

Sequence of Events in a Checkpoint

The following section outlines the main events that occur during a checkpoint once a user thread raises the checkpoint-requested flag. This section also notes the differences between full and fuzzy checkpoints:

  1. The database server prevents user threads from entering critical sections.
  2. The logical-log buffer is flushed to the current logical-log file on disk.
  3. The page-cleaner thread flushes the physical-log buffer.
  4. In a fuzzy checkpoint, the page-cleaner threads flush modified pages for nonfuzzy operations in the buffer pool to disk.

    In a full checkpoint, the page-cleaner threads flush all modified pages in the buffer pool to disk.

  5. The checkpoint thread writes a checkpoint record to the logical-log buffer.
  6. The physical log on disk is logically emptied. (Current entries can be overwritten).

User Threads Cannot Enter a Critical Section

This step is the same for both fuzzy and full checkpoints. Once the checkpoint-requested flag is set, user threads are prevented from entering portions of code that are considered critical sections. User threads that are within critical sections of code are permitted to continue processing to the end of the critical sections.

Logical-Log Buffer Is Flushed to the Logical-Log File on Disk

This step is the same for both fuzzy and full checkpoints. Next, the logical-log buffer is flushed to the logical-log file on disk.

Page-Cleaner Thread Flushes the Physical-Log Buffer

After all threads have exited from critical sections, the page-cleaner thread resets the shared-memory pointer from the current physical-log buffer to the other buffer and flushes the buffer. After the buffer is flushed, the page-cleaner thread updates the time stamp that indicates the most recent point at which the physical-log buffer was flushed.

Page-Cleaner Threads Flush Modified Pages in the Buffer Pool

In a fuzzy checkpoint, the page-cleaner threads flush modified pages for nonfuzzy operations in the buffer pool to disk. They do not flush modified pages for fuzzy operations (inserts, deletes, updates) to disk. Figure 91 shows how the database server writes only the nonfuzzy pages to disk. The shaded squares, marked F, represent the fuzzy pages.

Figure 91. Selectively Writing Modified Pages from Shared Memory to Disk
begin figure description - This figure is described in the surrounding text. - end figure description

In a full checkpoint, the page cleaners flush all modified pages in the shared-memory buffer pool to disk. This flushing is performed as a chunk write.

Checkpoint Thread Writes Checkpoint Record

This step is the same for both fuzzy and full checkpoints. The page-cleaner thread writes a checkpoint-complete record to the logical-log buffer after the modified pages have been written to disk.

In a fuzzy checkpoint, the checkpoint thread also writes a dirty-pages table (DPT) record to the logical-log buffer. For more information, see the chapter on logical-log record types in the IBM Informix: Administrator's Reference.

Physical Log Is Logically Emptied

This step is the same for both fuzzy and full checkpoints. After the checkpoint-complete record is written to disk, the physical log is logically emptied, meaning that current entries in the physical log can be overwritten.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]