The present invention is a system and method that facilitates consistency maintenance
and recovery from a system or process crash with valid data. A data consistency
maintenance and recovery system and method of the present invention utilizes a
dual page configuration and locking process to store and track data. A primary
page is utilized as the primary data storage location and a mirror page operates
as copy of the primary page except during certain stages of data manipulation (e.g.,
a write operation). In one embodiment of the present invention, a process can not
perform a read operation if the page is locked or a write operation if the process
did not lock the page. Read operations read information from unlocked primary pages.
Write operations access, lock and update a mirror page, then access, lock and update
a primary page. Page accesses are tracked (e.g., counted). Then a write process
unlocks and syncs the primary page to disk as well as the mirror page. A page with
consistent data is copied to a page with inconsistent data during a process system
crash recovery. In one embodiment of the present invention, a primary page is considered
consistent if a write operation has not accessed the primary page to begin a write
process, otherwise data on a mirror page is considered consistent. In one embodiment
of the present invention data being manipulated (e.g., change by a write operation)
is stored on a single page.