Question
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?
Official answer and solution
- Official answer
- C
- From
- Official GATE 2014 answer key
Solution
Construct the precedence graph to test for conflict-serializability, and inspect read-write dependencies to check recoverability.
-
Chronological Sequence of Operations:
-
Conflict Serializability (Precedence Graph):
- Conflict pairs on :
- before .
- before .
- before .
- before .
- before .
- Conflict pairs on :
- before .
- All directed edges: . There are no cycles in the graph, so schedule is conflict-serializable (equivalent serial order ).
- Conflict pairs on :
-
Recoverability Check:
- A schedule is recoverable if every transaction that reads data written by commits only after commits.
- reads written by : commits at step 5, and commits at step 11 ( commits before ).
- reads written by : commits at step 8, and commits at step 11 ( commits before ).
- No other dirty reads exist. Hence, schedule is recoverable.
-
Conclusion:
is both conflict-serializable and recoverable, which corresponds to option (C).
C
Missing the edge between T3 and T1 on Write(X)-Write(X) conflict, or assuming a read after commit makes a schedule non-recoverable.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 2
- Question
- 39 of 65, printed as CS Q.29
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.