Skip to content

Commit

Permalink
Add read version to the example in read-write set
Browse files Browse the repository at this point in the history
Signed-off-by: QQ喵 <gqqnb2005@gmail.com>
  • Loading branch information
gqqnbig authored and manish-sethi committed Nov 29, 2021
1 parent b0de139 commit 45707ac
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs/source/readwrite.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ each of these transactions.
World state: (k1,1,v1), (k2,1,v2), (k3,1,v3), (k4,1,v4), (k5,1,v5)
T1 -> Write(k1, v1'), Write(k2, v2')
T2 -> Read(k1), Write(k3, v3')
T2 -> Read(k1,1), Write(k3, v3')
T3 -> Write(k2, v2'')
T4 -> Write(k2, v2'''), read(k2)
T5 -> Write(k6, v6'), read(k5)
T4 -> Write(k2, v2'''), read(k2,1)
T5 -> Write(k6, v6'), read(k5,1)
Now, assume that these transactions are ordered in the sequence of
T1,..,T5 (could be contained in a single block or different blocks)
Expand All @@ -133,18 +133,18 @@ T1,..,T5 (could be contained in a single block or different blocks)
Further, the tuple of keys ``k1`` and ``k2`` in the world state are
updated to ``(k1,2,v1'), (k2,2,v2')``

2. ``T2`` fails validation because it reads a key, ``k1``, which was
modified by a preceding transaction - ``T1``
2. ``T2`` fails validation because it reads key ``k1`` of version 1 but ``k1``
in the world state has progressed to version 2

3. ``T3`` passes the validation because it does not perform a read.
Further the tuple of the key, ``k2``, in the world state is updated
to ``(k2,3,v2'')``
3. ``T3`` passes the validation because it does not perform a read. Further
the tuple of the key, ``k2``, in the world state is updated to
``(k2,3,v2'')``

4. ``T4`` fails the validation because it reads a key, ``k2``, which was
modified by a preceding transaction ``T1``
4. ``T4`` fails the validation because it reads key ``k2`` of version 1 but
``k2`` in the world state has progressed to version 3

5. ``T5`` passes validation because it reads a key, ``k5``, which was
not modified by any of the preceding transactions
5. ``T5`` passes validation because it reads a key, ``k5``, which is still on
version 1

**Note**: Transactions with multiple read-write sets are not yet supported.

Expand Down

0 comments on commit 45707ac

Please sign in to comment.