Docsity

Sequence of Undo Log Records - Assignment 4 | CPSC 608, Assignments of Deductive Database Systems

Toggle sidebar
bg1
CPSC-608 Database Systems
Fall 2008
Instructor: Dr. Jianer Chen
Office: HRBB 309B
Phone: 845-4259
Office Hours: T-TR 9:35am-10:50am
Assignment # 4
(Due December 2)
1. The following is a sequence of undo-log records written by two trans-
actions Tand U:
(start, T); (T, A, 10); (start U); (U, B , 20); (T, C, 30); (U, D , 40);
(commit U); (T, E , 50); (commit T).
Describe the action of the recover manger, including changes to both disk
and the log, if there is a crash and the last log record to appear on disk is:
(a) (start U)
(b) (commit U)
(c) (T, E , 50)
(d) (commit T)
2. Suppose that there are two lock modes, readlock and writelock. Give
a formal proof that if all transactions in a schedule have two-phase locking
structure, then the schedule is conflict-serializable.
3. For each of the sequences of actions below, tell what hapeens under
the wound-wait deadlock avoidance system and under the wait-die deadlock
avoidance system. Assume the order of deadlock-timestamps is the same
as the order of subscripts for the transactions, that is, T1,T2,T3,T4. Also
assume that transactions that need to restart do so in the order that they
were rolled back.
(a) r1(A), r2(B), w1(C), r3(D), r4(E), w3(B), w2(C), w4(A), w1(D);
(b) r1(A), r2(B), w1(C), w2(D), r3(C), w1(B), w4(D), w2(A).
1

Partial preview of the text

Download Sequence of Undo Log Records - Assignment 4 | CPSC 608 and more Assignments Deductive Database Systems in PDF only on Docsity!

CPSC-608 Database Systems

Fall 2008

Instructor: Dr. Jianer Chen Office: HRBB 309B Phone: 845- Email: [email protected] Office Hours: T-TR 9:35am-10:50am

Assignment # 4

(Due December 2)

  1. The following is a sequence of undo-log records written by two trans- actions T and U :

(start, T ); (T, A, 10); (start U ); (U, B, 20); (T, C, 30); (U, D, 40); (commit U ); (T, E, 50); (commit T ).

Describe the action of the recover manger, including changes to both disk and the log, if there is a crash and the last log record to appear on disk is: (a) (start U ) (b) (commit U ) (c) (T, E, 50) (d) (commit T )

  1. Suppose that there are two lock modes, readlock and writelock. Give a formal proof that if all transactions in a schedule have two-phase locking structure, then the schedule is conflict-serializable.
  2. For each of the sequences of actions below, tell what hapeens under the wound-wait deadlock avoidance system and under the wait-die deadlock avoidance system. Assume the order of deadlock-timestamps is the same as the order of subscripts for the transactions, that is, T 1 , T 2 , T 3 , T 4. Also assume that transactions that need to restart do so in the order that they were rolled back. (a) r 1 (A), r 2 (B), w 1 (C), r 3 (D), r 4 (E), w 3 (B), w 2 (C), w 4 (A), w 1 (D); (b) r 1 (A), r 2 (B), w 1 (C), w 2 (D), r 3 (C), w 1 (B), w 4 (D), w 2 (A).