Mirror resynchronization of fixed page length tables for better repair time to high availability in databases
AssigneePivotal Software, Inc.
InventorsMatthew C. McCline, Milena Bergant
Life of this patent
Estimating the term…
Abstract
In a mirrored database system, mirror resynchronization of fixed length pages is optimized for quick repair and high availability by identifying those lost page changes that must be made for resynchronization and ignoring other duplicate changes. Essential pages are identified using log sequence numbers (LSNs) to locate the most current version of a changed page, and other lower valued LSNs of less current versions of that page are eliminated as having changes that are duplicated in the current version of the page. Page changes since the last database checkpoint before losing mirror synchronization and the current LSN of the transaction log are identified as possibly necessary changes to be made.
Claims14
A method of mirror resynchronization of fixed length pages in a mirrored pair of databases comprising a primary database and a mirror database supporting transactions, the method comprising:
- writing, for each page change of a plurality of page changes to the fixed length pages, a record of the page change to a transaction log buffer until reaching a first checkpoint of a plurality of checkpoints, the checkpoints occurring at periodic intervals, wherein each record includes a log sequence number (LSN);
- upon reaching the first checkpoint, writing the records in the transaction log buffer to a primary transaction log file for the primary database and a mirror transaction log file for the mirror database;
- capturing in a change tracking log, upon loss of synchronization and after reaching the first checkpoint, write-related page changes written to the transaction log buffer with a LSN greater than the LSN of the first checkpoint;
- stopping, upon starting mirror resynchronization, the capturing of page changes in the change tracking log while continuing to record page changes due to ongoing transactions in the transaction log;
- determining, for each page referenced by a page change in the change tracking log, the most recent transaction for that page captured in the change tracking log;
- and
- updating the mirror database using the most recent transactions in the change tracking log for each page referenced by a page change in the change tracking log.
A non-transitory computer readable storage medium comprising executable instructions for controlling the operation of a computer to perform mirror resynchronization of fixed length pages in a mirrored pair of databases comprising a primary database and a mirror database supporting transactions, comprising instructions to:
- write, for each page change of a plurality of page changes to the fixed length pages, a record of the page change to a transaction log buffer until reaching a first checkpoint of a plurality of checkpoints occurring at periodic intervals, wherein each record includes a log sequence number (LSN);
- upon reaching the first checkpoint, write the records in the transaction log buffer to a primary transaction log file for the primary database and a mirror transaction log file for the mirror database;
- capture, in a change tracking log, upon loss of synchronization and after reaching the first checkpoint, write-related page changes written to the transaction log buffer with a LSN greater than the LSN of the first checkpoint;
- stop, upon starting mirror resynchronization, capturing of page changes in the change tracking log while continuing to record page changes due to ongoing transactions in the transaction log;
- determine, for each page referenced by a page change in the change tracking log, the most recent transaction for that page captured in the change tracking log;
- and
- update the mirror database using the most recent transactions in the change tracking log for each page referenced by a page change in the change tracking log.
Dependencies are inferred from the claim text.