# US 2012/0239628 A1 · Tracking redo completion at a page level

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2012/0239628 A1
- Document ID: US20120239628A1
- Status: Published application
- Kind: A1
- Application number: 13/051,970
- Filed: 2011-03-18
- Published: 2012-09-20
- Earliest claimed: 2011-03-18
- Assignees: Microsoft Corporation
- Inventors: Robin Dhananjay Dhamankar; Hanumantha Rao Kodavalla
- Web page: https://patentgrep.com/patent/US20120239628A1

## CPC

- G06F 11/1469: {Backup restoration techniques}
- G06F 16/217: {Database tuning (G06F16/2282 takes precedence; database performance monitoring G06F11/3409)}
- G06F 16/2455: Query execution
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments are directed to implementing a transitional redo phase to allow pre-redo phase data access and to determining which data pages including unprocessed transactions are to be processed during a transitional redo phase. In an embodiment, a computer system initiates an analysis phase of a database recovery that scans a database transaction log and builds a dirty page table that includes pages corresponding to unprocessed data transactions. The computer system determines from the dirty page table which pages are to be processed during the transitional redo phase, before the final redo phase. The computer system processes the determined pages during the transitional redo phase, before the final redo phase is reached and, upon completion of the system transaction undo phase, makes available those pages that were processed during the transitional redo phase, as well as those database pages that are not scheduled for processing during the final redo phase.

## Claims

### Claim 1

In a computer system including at least one processor and a memory, and which is included in a computer networking environment including a plurality of other computing systems and at least one database server, a computer-implemented method for implementing a transitional redo phase during recovery following a failure of the database or database server, the transitional redo phase allowing at least limited access to the database prior to a final redo phase which provides full recovery, the computer-implemented method comprising the following acts:
following detection of a database failure at a database server, initiating an analysis phase of a database recovery by scanning database transaction log to identify dirty pages that represent pages having unprocessed data transactions as a result of the database failure;
building a table of the identified dirty pages;
analyzing the table of identified dirty pages using one or more predetermined criteria to determine which dirty pages are to be prioritized for processing during the transitional redo phase and prior to a full recovery provided during a final redo phase, when all other dirty pages will be processed;
processing the prioritized dirty pages during the transitional redo phase and before the final redo phase is reached; and
upon completion of a system transaction undo phase which corresponds to completion of all unprocessed data transactions of the prioritized dirty pages, making available to database users the previously prioritized dirty pages with the now completed data transactions for them that were processed during the transitional redo phase, and also making available to database users any other pages that were unaffected by the database failure, and then beginning the final redo phase to complete full database recovery for any remaining dirty pages that were not prioritized, so that all pages made available at completion of the system transaction undo phase are accessible by database users even during the final redo phase.

### Claim 2 (depends on 1)

The method of claim 1, wherein database recovery is tracked at a page level, such that any remaining dirty pages that were not prioritized that are being processed in the final redo phase are only blocked until each such page is redone, with at least some completed pages then being released for access by database users before the final redo phase is complete.

### Claim 3

(canceled)

### Claim 4 (depends on 1)

The method of claim 1, further comprising adding a flag to entries of the dirty page table corresponding to prioritized dirty pages that are to be processed during the transitional redo phase.

### Claim 5 (depends on 4)

The method of claim 4, further comprising instantiating an event configured to wait for any remaining dirty pages of the dirty page table that were not flagged and are thus scheduled for processing during the final redo phase.

### Claim 6 (depends on 4)

The method of claim 4, further comprising creating a linked list of the prioritized dirty pages that are to be processed during the transitional redo phase using the added flags.

### Claim 7 (depends on 1)

The method of claim 1, further comprising determining which pages are required to be completed to define the system transaction undo phase which corresponds to completion of all unprocessed data transaction of the prioritized dirty pages.

### Claim 8 (depends on 7)

The method of claim 7, further comprising flagging those prioritized dirty pages that are to be processed for the system transaction undo phase, wherein the flags indicate that the prioritized dirty pages are to be processed in order to complete the transitional redo phase.

### Claim 9 (depends on 1)

The method of claim 1, wherein the prioritized dirty pages that are to be processed during the transitional redo phase comprise priority data pages that have been accessed a threshold number of times.

### Claim 10 (depends on 9)

The method of claim 9, wherein the priority data pages comprise at least one of the following: a system transaction page, a transaction log, an allocation map, higher level B-Tree indexes and any other pages frequently accessed by a workload.

### Claim 11 (depends on 1)

The method of claim 1, further comprising reacquiring locks for user transaction undo to ensure that users are prevented from accessing uncommitted data.

### Claim 12 (depends on 1)

The method of claim 1, any remaining dirty pages of the dirty page table that were not prioritized and are thus scheduled for processing during the final redo phase are latched before being accessed, such that during the final redo phase, if a page is waiting to be re-processed and if redo is not complete, user requests are blocked until the final redo phase completes processing the requested page.

### Claim 13 (depends on 1)

The method of claim 1, wherein upon determining that a page is not found in the dirty page table, a latch is applied to that page and access to the page is allowed in response to user requests.

### Claim 14

In a computer system including at least one processor and a memory, and which is included in a computer networking environment including a plurality of other computing systems and at least one database server, a computer program product comprising physical computer storage media having computer-executable instructions which, when executed by a processor, cause a computing system to implement a method for a transitional redo phase during recovery following a failure of the database or database server, the transitional redo phase allowing at least limited access to the database prior to a final redo phase which provides full recovery, and the computer-implemented method comprising the following acts:
following detection of a database failure at a database server, initiating an analysis phase of a database recovery by scanning a database transaction log to identify dirty pages that represent pages having unprocessed data transactions as a result of the database failure;
building a table of the identified dirty pages;
analyzing the table of identified dirty pages using one or more predetermined criteria to determine which dirty pages are to be prioritized for processing during the transitional redo phase and prior to a full recovery provided during a final redo phase, when all other dirty pages will be processed;
processing the prioritized dirty pages during the transitional redo phase and before the final redo phase is reached; and
upon completion of a system transaction undo phase which corresponds to completion of all unprocessed data transactions of the prioritized dirty pages, making available to database users the previously prioritized dirty pages with the now completed data transactions for them that were processed during the transitional redo phase, and also making available to database users any other pages that were unaffected by the database failure and then beginning the final redo phase to complete full database recovery for any remaining dirty pages that were not prioritized, so that all pages made available at completion of the system transaction undo phase are accessible by database users even during the final redo phase.

### Claim 15

(canceled)

### Claim 16 (depends on 14)

The computer program product of claim 14, wherein the computer-executable instructions for the method include flagging the prioritized dirty pages for processing during the transitional redo phase.

### Claim 17 (depends on 16)

The computer program product of claim 16, wherein the computer-executable instructions for the method include instantiating an event configured to wait for the prioritized dirty pages that are flagged for processing during the transitional redo phase.

### Claim 18 (depends on 16)

The computer program product of claim 16, wherein the computer-executable instructions for the method include creating a linked list of the flagged dirty pages that are to be processed during the transitional redo phase.

### Claim 19

A computer system comprising the following:
one or more processors;
system memory;
at least one database server having a stored database;
one or more computer storage media having stored thereon computer-executable instructions that, when executed by the one or more processors, cause a computer-implemented method to be performed for a transitional redo phase during recovery following a failure of the database or database server, the transitional redo phase allowing at least limited access to the database prior to a final redo phase which provides full recovery, and the computer-implemented method comprising the following acts:
following detection of a database failure at a database server, initiating an analysis phase of a database recovery by scanning a database transaction log to identify dirty pages that represent pages having unprocessed data transactions as a result of the database failure;
building a table of the identified dirty pages;
analyzing the table of identified dirty pages using one or more predetermined criteria to determine which dirty pages are to be prioritized for processing during the transitional redo phase and prior to a full recovery provided during a final redo phase, when all other dirty pages will be processed;
processing the prioritized dirty pages during the transitional redo phase and before the final redo phase is reached;
upon completion of a system transaction undo phase which corresponds to completion of all unprocessed data transactions of the prioritized dirty pages, making available to database users the previously prioritized dirty pages with the now completed data transactions for them that were processed during the transitional redo phase, and also making available to database users any other pages that were unaffected by the database failure, and then beginning the final redo phase to complete full database recovery for any remaining dirty pages that were not prioritized, so that all pages made available at completion of the system transaction undo phase are accessible by database users even during the final redo phase; and
during the final redo phase, as the uncompleted data transactions are completed for each of the other dirty pages that were not prioritized, making those pages available to database users as each additional page is completed, so that requested pages that are being processed in the final redo phase are only blocked until the requested page is redone, and are released on a page-by-page basis while the final redo phase is being completed.

### Claim 20 (depends on 19)

The system of claim 19, wherein user requests are received and processed at the database before the final redo phase is complete.
