Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by r(x) and w(x) respectively. Which one of them is conflict serializable?
Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by r(x) and w(x) respectively. Which one of them is conflict serializable? Correct Answer r<sub>2</sub>(x); w<sub>2</sub>(x); r<sub>3</sub>(x); r<sub>1</sub>(x); w<sub>1</sub>(x)
Concept:
A schedule is called conflict serializable if it can be transformed into a serial schedule by swapping non-conflicting operations.
For a schedule to be conflict serializable, there should be no cycle present in its precedence graph.
Explanation:
Option_1 – Not conflict serializable
|
T1 |
T2 |
T3 |
|
r(x) |
|
|
|
|
r(x) |
|
|
w(x) |
|
|
|
|
|
r(x) |
|
|
w(x) |
|
[ alt="F2 R.S 15.7.20 Pallavi D1" src="//storage.googleapis.com/tb-img/production/20/07/F2_R.S_15.7.20_Pallavi_D1.png" style="width: 147px; height: 127px;">
- Cycle between T1 and T2.
- Cycle between T1->T3->T2
Option_2 – Not conflict serializable
|
T1 |
T2 |
T3 |
|
|
r(x) |
|
|
r(x) |
|
|
|
|
w(x) |
|
|
|
|
r(x) |
|
w(x) |
|
|
[ alt="F2 R.S 15.7.20 Pallavi D2" src="//storage.googleapis.com/tb-img/production/20/07/F2_R.S_15.7.20_Pallavi_D2.png" style="width: 146px; height: 127px;">
- Cycle between T1 and T2.
- Cycle between T1->T2->T3
Option-3 - Not conflict serializable
|
T1 |
T2 |
T3 |
|
|
|
r(x) |
|
|
r(x) |
|
|
r(x) |
|
|
|
|
w(x) |
|
|
w(x) |
|
|
[ alt="F2 R.S 15.7.20 Pallavi D3" src="//storage.googleapis.com/tb-img/production/20/07/F2_R.S_15.7.20_Pallavi_D3.png" style="width: 148px; height: 119px;">
- Cycle between T1 and T2.
Option-4 - Conflict serializable
|
T1 |
T2 |
T3 |
|
|
r(x) |
|
|
|
w(x) |
|
|
|
|
r(x) |
|
r(x) |
|
|
|
w(x) |
|
|
[ alt="F2 R.S 15.7.20 Pallavi D4" src="//storage.googleapis.com/tb-img/production/20/07/F2_R.S_15.7.20_Pallavi_D4.png" style="width: 142px; height: 118px;">
- No cycle
Hence, Option_4 is a conflict serializable schedule