edited by
7,296 views
5 votes
5 votes

Assume basic timestamp ordering protocol and that time starts from $1$, each operation takes unit amount of time and start of transaction $T_i$ is denoted as $S_i$. The table of timestamp is given below:

Find $rts(a), wts(a), rts(b)$ and $wts(b)$ at the end

  1.   1, 5, 2, 5
  2.   1, 7, 3, 3
  3.   3, 7, 3, 7
  4.   1, 7, 3, 7
edited by

2 Answers

Best answer
16 votes
16 votes

Here,

T1 starts at TS =1

T2 starts at TS = 3

T3 starts at TS =7.

While giving the the TS for any read or write always look for youngest.

RTS(a) = a is first read by T1 hence RTS(a) =1. (Read(a) is never done anywhere again hence it is youngest)

WTS(a) = a is first written by T2 hence WTS(a) = 3. But again written by T3 which has higher TS (youngest) Hence final TS of W(a) = 7

RTS(b) = b is first read by T2 hence RTS(b) =3. (Read(b) is never done anywhere again hence it is youngest)

WTS(b) = b is first written by T2 hence WTS(b) = 3. But again written by T3 which has higher TS (youngest) Hence final TS of W(b) = 7

Hence answer is 1,7,3,7
selected by
4 votes
4 votes

Given information will be represented as in figure above. Now TS to a data item is assigned as the TS of latest transaction which accessed it. So RTS(a)= TS(S1)=1

WTS(a) = TS(S3) = 7, RTS(b) = TS(S2) = 3, WTS(b) = TS(S3)= 7 and thus option D is right answer.

"We can do it directly from given table also, then no need to make above table"

Related questions

2 votes
2 votes
1 answer
3
techbrk3 asked Nov 9, 2017
1,499 views
(TS: time stamp)If TS (T) < Read-TS (Q), then write is rejected and T is rolled backIf TS (T) < write-TS (Q), then write is rejected and T is rolled backBoth (A) and (B)N...
0 votes
0 votes
1 answer
4