COMP9315 Final Exam The University of New South Wales
COMP9315 DBMS Implementation
Final Exam
DBMS Implementation
[Instructions] [Notes] [PostgreSQL] [C]
[Q1] [Q2] [Q3] [Q4] [Q5] [Q6] [Q7] [Q8]

Question 8 (6 marks)

Consider the followng three transactions:

T1:                 T2:                 T3:
read(X)             read(Y)             read(X)
X = X + 1           Y = Y * 2           read(Y)
write(X)            read(X)             X = X - Y
read(Y)             X = X + Y           Y = Y - 3
Y = Y + 1           write(Y)            write(X)
write(Y)            write(X)            write(Y)
commit              commit              commit

Consider also the following concurrent schedule on these three transactions:

T1: R(X)      W(X)      R(Y)                W(Y) C       |
T2:      R(Y)                R(X)      W(Y)        W(X)  | system
T3:                R(X)           R(Y)                   | failure

Note that we have omitted the computation on X and Y from the schedule. You should assume that it occurs somwhere between the read and the write of the relevant variable. The line of | symbols indicates where a system failure occurred.

Making the following assumptions:

answer these questions:

  1. Show all entries written to the log as the transactions progress in the given schedule
    (include <start Ti>, <abort Ti>, and <commit Ti>, entries as well as entries for updates)

  2. Show how recovery takes place when the system restarts after the system failure

    • which transactions are placed on the undo and redo lists
    • which undo operations occur; which redo operations occur

Show all working.

Instructions:

End of Question