Question

Let Ri(z)R_i(z) and Wi(z)W_i(z) denote read and write operations on a data element zz by a transaction TiT_i, respectively. Consider the schedule SS with four transactions.

S:R4(x)R2(x)R3(x)R1(y)W1(y)W2(x)W3(y)R4(y)S: R_4(x) R_2(x) R_3(x) R_1(y) W_1(y) W_2(x) W_3(y) R_4(y)

Which one of the following serial schedules is conflict equivalent to SS?

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2022 answer key

Solution

Construct the conflict serializability precedence graph from conflicting read and write operations.

Given schedule S:R4(x)R2(x)R3(x)R1(y)W1(y)W2(x)W3(y)R4(y)S: R_4(x) R_2(x) R_3(x) R_1(y) W_1(y) W_2(x) W_3(y) R_4(y).

We identify conflicting operations (operations by different transactions on the same data item where at least one is a write) in order of appearance:

  1. Conflicts on xx:
    • R4(x)R_4(x) occurs before W2(x)  ⟹  T4→T2W_2(x) \implies T_4 \to T_2
    • R3(x)R_3(x) occurs before W2(x)  ⟹  T3→T2W_2(x) \implies T_3 \to T_2
  2. Conflicts on yy:
    • R1(y)R_1(y) occurs before W3(y)  ⟹  T1→T3W_3(y) \implies T_1 \to T_3
    • W1(y)W_1(y) occurs before W3(y)  ⟹  T1→T3W_3(y) \implies T_1 \to T_3
    • W1(y)W_1(y) occurs before R4(y)  ⟹  T1→T4R_4(y) \implies T_1 \to T_4
    • W3(y)W_3(y) occurs before R4(y)  ⟹  T3→T4R_4(y) \implies T_3 \to T_4

Summarizing the precedence edges:

  • T1→T3T_1 \to T_3
  • T3→T4T_3 \to T_4
  • T4→T2T_4 \to T_2

This directed acyclic graph has a unique topological sort:

T1→T3→T4→T2T_1 \to T_3 \to T_4 \to T_2

This matches Option (A).

Final answer

Option (A)

Common trap

Missing the conflict between W3(y)W_3(y) and R4(y)R_4(y) which enforces T3→T4T_3 \to T_4.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2022 Computer Science and Information Technology (CS)
Question
39 of 65
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.