Consider the following schedule S of transactions T1, T2, T3, T4: T1 T2 T3 T4 Reads(X) Writes(X) Commit Writes(X) Commit Writes(Y) Reads(Z) Commit Reads(X) Reads(Y) Commit Which one of the following statements is CORRECT?
Consider the following schedule S of transactions T1, T2, T3, T4: T1 T2 T3 T4 Reads(X) Writes(X) Commit Writes(X) Commit Writes(Y) Reads(Z) Commit Reads(X) Reads(Y) Commit Which one of the following statements is CORRECT? Correct Answer S is both conflict-serializable and recoverable
Concept:
- Using precedence graph method we can find out Schedule is conflict serializable or not.
- If precedence graph has any loop then that schedule is going to be not conflict-serializable.
- If precedence graph doesn’t have any loop then that schedule is going to be conflict-serializable.
- If one transaction ( T1 )is writing some value x and that value is read by some other transaction(T2) then T1 should commit first then only T2 should read that value and commit in order to become recoverable schedule.
Explanation:
[ alt="F1 R.S 14.7.20 Pallavi D1" src="//storage.googleapis.com/tb-img/production/20/07/F1_R.S_14.7.20_Pallavi_D1.png" style="width: 165px; height: 158px;">
- There is no loop in this graph so schedule is conflict serializable.
- T2: T3: T1: T4 is the only serial schedule that is equivalent to given schedule. (Using Topological Sorting)
- There are two write read dependency
- T1 write(X) and T4 read (X)
- T2 write (Y) and T4 read (Y)
- In first case T1 is committed first then read by T4 then T4 is committed so this is recoverable.
- In second case T2 is committed first then read by T4 then T4 is committed so this is also recoverable so schedule S is recoverable.
Hence option 3 is the correct answer.
মোঃ আরিফুল ইসলাম
Feb 20, 2025