Browse Prior Art Database

Improved Recovery from Partial Page Writes of Data Pages

IP.com Disclosure Number: IPCOM000104589D
Original Publication Date: 1993-May-01
Included in the Prior Art Database: 2005-Mar-19
Document File: 4 page(s) / 150K

Publishing Venue

IBM

Related People

Ballard, DJ: AUTHOR [+3]

Abstract

Disclosed is a method to allow database crash recovery after a partial page write to a data page (due to a power failure, for example) when the page has not been reorganized for data compaction.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 34% of the total text.

Improved Recovery from Partial Page Writes of Data Pages

      Disclosed is a method to allow database crash recovery after a
partial page write to a data page (due to a power failure, for
example) when the page has not been reorganized for data compaction.

      A database management system typically uses a write-ahead
logging protocol to insure recoverability after a system crash.  All
changes to the database are written to the recovery log before the
changes are written to the database.  If the system crashes, all
committed changes can be replayed from the recovery log.  Typically,
changes are logged at the logical record level.  That is, when a row
is inserted, the new record image is logged, when a row is deleted,
the old record image is logged, and when the a row is updated, both
the old and new record image is logged.  The exact physical changes
to the database are not logged -- they are reconstructed from the
logical changes during recovery.  This is sufficient as long as the
system can guarantee the atomicity of write operations involving the
physical changes.  A "page" is the smallest piece of the database to
which physical changes can be applied (typically 4K).  If the system
cannot guarantee the atomicity of a page write operation (i.e. once a
write operation begins, either the entire page is written or none of
it is written), database integrity may be compromised by a partial
page write if any data on the page that has been modified cannot be
completely reconstructed from the recovery log.

      In Database Manager, when a page becomes fragmented with free
space, it may become necessary to perform some record compaction to
collect the free space.  The operation is referred to as a page
reorg.  This operation moves records on the page to new locations,
making room for an insert or update.  Furthermore, the only changes
logged are for the actual insert or update.  Therefore, if the system
crashes and the new page image is partially written to disk, some of
the record data may not be recoverable.  For example, if a row stored
at offset 100 on a page is moved to offset 2000 on the page, and only
the first 1000 bytes of the new page are written when the system
crashes, then there will not be a valid copy of the row on the
resulting page.

      In Database Manager, whenever a page is read into the buffer
pool during crash recovery, validation is performed to determine if
the page was only partially written to disk.  Whenever this occurs,
crash recovery is aborted, and the database must be restored from
backup.  Forward Recovery may be used if log retention has been
configured.  The difference between being able to crash recover from
the online recovery log and having to restore a database and forward
recover from the archival logs is a significant availability impact
for customers with non-stop production applications.  In the event of
a power failure, it is highly desirable that crash recovery succ...