Information Technology Reference
In-Depth Information
modified-page table is reconstructed by initializing it from the copy found logged
at the checkpoint and inserting entries for pages that became modified after the
checkpoint was taken. In the redo pass, the complete history is repeated from the
log survived at the server's log disk, redoing all updates found logged at the server.
In the undo pass, nothing needs to be done, since we have assumed that the server
runs no transactions of its own. On the other hand, if transactions are run at the server
under an instance of the client database system, then that client has crashed along
with the server, so that ARIES recovery must be performed for that client in the way
explained in the previous section.
There is a pitfall that must be avoided in the analysis pass. A page updated
by a client and shipped to the server and marked there as modified before the
server's last checkpoint appears in the reconstructed modified-page table, because it
appears in the logged checkpoint. Similarly, a page that turned modified after the last
checkpoint and whose log records were shipped to the server and taken to the log
disk before the server failure also appears in the reconstructed modified-page table,
because during the log scan in the analysis pass all pages for which log records are
found in the log are registered in the modified-page table if not found there already.
But the reconstructed modified-page table does not necessarily contain an
unmodified page that before the checkpoint was shipped to some client for updating
for the first time. The log records for updates on such a page—but not the
page itself—may have arrived to the server and taken to the log disk before the
checkpoint.
Example 14.4 The following scenario is possible:
1. Page p is fetched from disk and shipped to client c for updating.
2. Transaction T at client c updates page p and commits. The log records written
for T are shipped to the server and appended to the server's log:
a 2 W n 2 Wh c; T; W; p; x; u ; v ;n 1 i ,
a 3 W n 3 Wh c; T; C i .
Page p is not shipped; it remains at c cached for writing.
3. The server takes a checkpoint:
a 4 Wh begin-checkpoint i .
a 5 Wh modified-page-table f ::: gi — does not contain an entry for p.
a 6 Wh end-checkpoint i .
4. The updated page p is called back from client c to be cached at another client.
5. Client c responds with a copy of page p and log records.
6. The server appends the log records to the log buffer, installs p into its buffer,
inserts an entry for p in the modified-page table, acknowledges the receipt of the
page and log records, and ships a copy of p to the requesting client.
7. Client c purges p from its cache.
8. The server crashes due to a failure.
Search WWH ::




Custom Search