C 1 point suppose instead of reading b at time

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 4 R(C) 5 6 7 8 9 10 11 12 13 14 R(A) 15 16 17 18 19 20 21 W(A) 22 23 T1 T2 T3 R(A) R(B) W(B) R(B) R(C) W(C) 6 SID: ____________________________ (a) [2 points] Recall the definition of a precedence graph: “A precedence graph has a node for each committed transaction, and an arc from Ti to Tj if an action of Ti precedes and conflicts with one of Tj’s actions.” Draw a precedence graph for the schedule on the previous page. (b) [2 points] Is the schedule on the previous page conflict ­serializable? If so, what order should the transactions be executed in to produce a conflict ­equivalent serial schedule? (c) [1 point] Suppose instead of reading B at time 12, transaction 3 reads B at time 7. Draw a precedence graph for this modified schedule. (d) [1 point] Is the schedule of part (c) conflict ­serializable? If so, what order should the transactions be executed in to produce a conflict ­equivalent serial schedule? (e) [4 points] Add lock/unlock actions into the schedule on the previous page in a way compliant with (non ­strict) two ­phase locking. Use L(X) to lock a data element X, and U(X) to unlock it. At most one box on each row should contain an action, and it may contain only one action. You should only use exclusive locks, not shared (read) locks. No locks should remain held at the end of the schedule. 7 SID: ____________________________ Q4: Logging and recovery [11 points] Your database server has just crashed due to a power outage. You boot it back up, find the following log and checkpoint information on disk, and begin the recovery process. Assume we use a STEAL/NO FORCE recovery policy. Transaction table at time of checkpoint LSN Record prevLSN Transaction lastLSN Status 30 update: T3 writes P5 null ID 40 update: T4 writes P1 null T1 70 Running 50 update: T4 writes P5 40 T2 60 Running 60 update: T2 writes P5 null T3 30 Running 70 update: T1 writes P2 null T4 50 Running 80 Begin Checkpoint  ­ 90 update: T1 writes P3 70 Dirty page table at time of checkpoint 100 End Checkpoint  ­ Page ID recLSN 110 update: T2 writes P3 60 P5 50 120 T2 commit 110 P1 40 130 update: T4 writes P1 50 140 T2 end 120 150 T4 abort 130 160 update: T5 writes P2 Null 180 CLR: undo T4 LSN 130 150 (a) [3 points] The log record at LSN 60 says that transaction 2 updated page 5. Was...
View Full Document

This note was uploaded on 01/24/2014 for the course CS 186 taught by Professor Staff during the Fall '08 term at University of California, Berkeley.

Ask a homework question - tutors are online