921 views
2 votes
2 votes
what is the meaning of TS(Ti) < WTS(Q) and TS(Ti) > WTS(Q)

Ti issuing read on data item Q.

please someone clear my doubt  i am very confuse in these terms.

1 Answer

Best answer
1 votes
1 votes

In timestamp based protocol for concurrency control , the most important line being :

a ) The conflict pairs (R-W , W-R or W - W) are ensured to occur in the same order as the timestamp values of  the transaction are..Hence conflict equal serial schedule is given by timestamp values of the transactions of the schedule.

b) More is the value of timestamp , younger is the transaction .In other words , less is the value of timestamp older the transaction .  Actually timestamp is nothing but amount of time spent (say number of seconds) w.r.t a given start time(say 00:00:00 of 1st Jan 1980).. 

 Now here 2 variables are used for a data item Q : RTS(Q) and WTS(Q) :

RTS(Q) indicates the timestamp value of the youngest transaction that has read the data item Q successfully.So is the case for WTS(Q) which concerns for successful write instead. 

Now we have some  WTS(Q) and say a transaction Ti issues read operation on Q..As there is a read ,and possible conflict operation is "write" on that data item ,so we need to check the WTS(Q) against the timestamp value of Ti denoted by TS(Ti)..We have some value of WTS(Q) means some other instruction Tj  has already performed write and hence Tj --> Ti .. 

Hence same should be reflected by timestamp value as well..As Tis younger hence it should have greater than or equal to timestamp value than Tj and hence greater timestamp value than WTS(Q)..

Hence the condition :  TS(Ti) >= WTS(Q) then only the read will be allowed and in that case we read and then set RTS(Q) to the  timestamp value of current transaction which is Ti..

Hence the condition : WTS(Q) > TS(Ti) leads to rollback of transaction Ti..

Similarly when a transaction issues write operation then conflict may occur due to read or write by other instruction on the same data item..

So for transaction Ti to run successfully , the condition is :

RTS(Q) <= TS(Ti)  and  WTS(Q) <= TS(Ti)  , then we write successfully and set WTS(Q) to the timestamp of current transaction i.e. Ti ..

However this is for basic timestamp protocol..

There is a slight modification  to this in one more protocol known as Thomas write protocol..

In this case , if we have write operation and WTS(A)  > TS(T) , then we do not rollback it but we simply ignore it as opposed to the case of basic timestamp protocol..

So Basic Timestamp protocol is similar to conflict serialisability and Thomas Write is similar to view serialisability..I hope this clears ur doubt..:) 

selected by

Related questions

3 votes
3 votes
1 answer
1
rahul sharma 5 asked Jan 8, 2017
1,773 views
Schedule S:- R1(A) R2(B) R3(C) R1(B) R2(C)R3(D)W1(C)W2(D)W3(E) , following is the dependency graphWhich of the transaction is rollbacked if Time stamp order is?a.) (T1,...
1 votes
1 votes
1 answer
2
LavTheRawkstar asked Mar 17, 2017
2,469 views
What is the difference between Pessimistic time stamp ordering and optimistic time stamp ordering.
0 votes
0 votes
1 answer
3