Homework 4
CS422, Summer 2009

Due: Wednesday, August 19

Please upload your files to CSNS. Note that file uploading will be disabled automatically after 11:59PM of the due date, so please turn in your work on time.


1. (30pt) For a transaction T, consider the following sequence of operations performed by a DBMS:

Start Transaction
<START, T>
<UPDATE, T, X, vx, vx'>
Write(X, vx')
<UPDATE, T, Y, vy, vy'>
Write(Y, vy’)
Flush(log);
Flush(X);
<COMMIT, T>
Flush(log)
Commit;
Flush(Y)

Suppose a system crash may happen between any two operations in the sequence. Please answer the following questions:

(a) Can the DBMS recover from a system crash using Undo-only Recovery? If the answer is no, use an example to explain why.

(b) Can the DBMS recover from a system crash using Redo-only Recovery? If the answer is no, use an example to explain why.

(c) Can the DBMS recover from a system crash using Undo/Redo Recovery? Briefly explain why.

For this exercise, please put your answers in a file in TXT, PDF, DOC, or ODT format and upload it to CSNS.

2. (70pt) Implement Undo/Redo Recovery in SimpleDB, including test code to show that your implementation works correctly. For this exercise, you must submit two files: