Question
Let be the following schedule of operations of three transactions , and in a relational database system:
Consider the statements and below:
: is conflict-serializable.
: If commits before finishes, then is recoverable.
Which one of the following choices is correct?
Official answer and solution
- Official answer
- B
- From
- Official GATE 2021 answer key
Solution
Build the serialization graph to test conflict serializability, and examine read-write dependencies across transactions to test recoverability.
The schedule is:
Testing Statement P (Conflict Serializability):
Find all conflicting operations between distinct transactions:
- Variable : precedes .
- Variable : precedes .
- Variable : precedes .
The edges in the precedence graph are , , and . The graph has no cycles (topological sort order: ). Hence, is conflict-serializable. Statement is true.
Testing Statement Q (Recoverability):
- In schedule , transaction reads after writes ( followed by ). Thus, reads uncommitted data from (a dirty read dependency).
- In a recoverable schedule, for any transaction that reads a value written by , must commit before commits.
- Statement states: 'If commits before finishes, then is recoverable'. If commits before finishes, and then subsequently aborts, has committed using aborted data and cannot be rolled back, making the schedule unrecoverable. Hence, statement is false.
Therefore, is true and is false, which matches option B.
B
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2021 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 42 of 65, printed as CS Q.32
- 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.