retagged by
728 views
0 votes
0 votes

Consider the following schedule:

$\begin{array}{|c|c|} \hline T1&  T2 \\ \hline R(A) &{} \\ \hline R(B) & {} \\ \hline R(C) & {} \\ \hline {} & R(A) \\ \hline {} & R(B) \\ \hline {} & F: \text{_____} \\ H: \text{______} & {} \\ \hline {} & R(C) \\ \hline \end{array}$

What are the possible values of F & H for which the above schedule is allowed under Thomas Write Rule but NOT under Basic Timestamp Ordering Protocol if $\text{timestamp(T2)} > \text{timestamp(T1)}$?

  1. $W(B), W(C)$
  2. $W(A), W(A)$
  3. $W(A) ,W(B)$
  4. $W(C), W(A)$
retagged by

1 Answer

Best answer
2 votes
2 votes

The answer looks bigger(I noticed after writing) it is because I copied the above table twice, otherwise there are just a few lines. 

 T1         T2
 R(A)  
 R(B)  
 R(C)  
    R(A)
    R(B)
   F:___W(B)______

 H:____W(C)____

 
   R(C)

Option A allows both in basic timestamp ordering and Thomas write rule,
W(C) of T1 checks the Read_TS(C)>TS(T1) || Write_TS(C)>TS(T1)
which will be false
i.e. no new transaction has read C before T1,  so T1 can write successfully.
 After that T2 will check for Write_TS(C)>TS(T2) which will be false i.e now newer transaction has written before T2 want to read it, so allowed to read C.

 T1         T2
 R(A)  
 R(B)  
 R(C)  
    R(A)
    R(B)
   F:__W(A)_______
 H:__W(A)______  
   R(C)

    Option B:

Let T1, T2 have timestamps as 100,200 i.e T1 is older and T2 is newer.

Then when T2 want to write(A) it will check
Read_TS(A)>TS(T2) || Write_TS(A)>TS(T2) which will be false as lastly T2 itself read the value and now newer transaction has written or read A. So T2 will be allowed to Write A and update Write_TS(A)=200. 

when T1 want to write(A) it will check
Read_TS(A)>TS(T1) || Write_TS(A)>TS(T1) which will be true, hence it will be not allowed in to do this operation and will be rolled back.
But in timestamp ordering this will allowed as just this Write(A) of T1 will be just ignored, T2 has already written the new value of A.
 

To get the last line, it means if T1 has to write the value of A as 10 and T2 as 20 when they executed in timestamp order(T1->T2 as TS(T1)<TS(T2)) last value of A will be written by T2 i.e 20. But Thomas is a smart guy, he thought when T2 has already updated A's value as 20 why to bother about T1 which is updating it to an obsolete value, so he just ignored the T1's Write(A).

selected by
Answer:

Related questions

314
views
1 answers
1 votes
Bikram asked Aug 26, 2017
314 views
Given below are some transaction schedules that involve three transactions $T1 \ T2 \ T3$:$\textbf{Schedule 1:}$T2 : Rx , T2 : Ry , T1 : Wx ... above given schedules is conflict serializable?Schedule $1$Schedule $2$Schedule $3$Schedule $4$
351
views
1 answers
2 votes
Bikram asked Aug 26, 2017
351 views
Consider the following transaction involving two bank accounts $A$ and $B$ ... of the accounts $A$ and $B$ should remain constant is that of:AtomicityConsistencyIsolationDurability
368
views
1 answers
1 votes
Bikram asked Aug 26, 2017
368 views
A schedule with two transactions T1 and T2 is as mentioned below: ... is an example of:Cascade-less scheduleRecoverable scheduleBoth Cascade-less and Recoverable scheduleIrrecoverable schedule
521
views
2 answers
3 votes
Bikram asked Aug 26, 2017
521 views
Which of the following is TRUE about the given schedule S? ... but not conflict serializable.It is conflict serializable but not view serializable.It is not serializable.