Skip to content

Commit

Permalink
storage: additional TestMVCCHistories cases for scan/get
Browse files Browse the repository at this point in the history
Release justification: non-production code changes

Release note: None
  • Loading branch information
erikgrinaker committed Aug 25, 2022
1 parent 1fadff6 commit d0e02db
Show file tree
Hide file tree
Showing 2 changed files with 643 additions and 0 deletions.
276 changes: 276 additions & 0 deletions pkg/storage/testdata/mvcc_histories/range_tombstone_gets_complex
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
# Tests MVCC gets across range tombstones, with a more complex dataset.
#
# Sets up the following dataset, where x is tombstone, o-o is range tombstone, [] is intent.
#
# T
# 7 [d7] [f7] [j7]
# 6 f6
# 5 o-------------------o k5 o-----------o
# 4 x x d4 f4 g4
# 3 o-------o e3 o-------oh3 o---o
# 2 a2 d2 f2 g2
# 1 o-------------------o o-----------o
# a b c d e f g h i j k l m n o p
#
run ok
put_rangekey k=a end=f ts=1
put_rangekey k=h end=k ts=1
put_rangekey k=b end=d ts=3
put_rangekey k=n end=o ts=3
put_rangekey k=l end=o ts=5
put k=a ts=2 v=a2
del k=a ts=4
del k=b ts=4
put k=d ts=2 v=d2
put k=d ts=4 v=d4
put k=e ts=3 v=e3
put k=f ts=2 v=f2
put k=g ts=2 v=g2
put_rangekey k=f end=h ts=3 localTs=4
put k=f ts=4 v=f4
put k=f ts=6 v=f6
put k=g ts=4 v=g4
put_rangekey k=c end=h ts=5
put k=h ts=3 v=h3
put k=k ts=5 v=k5
with t=A
txn_begin ts=7
put k=d v=d7
put k=f v=f7
put k=j v=j7
----
del: "a": found key true
del: "b": found key false
>> at end:
txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=7.000000000,0 min=0,0 seq=0} lock=true stat=PENDING rts=7.000000000,0 wto=false gul=0,0
rangekey: {a-b}/[1.000000000,0=/<empty>]
rangekey: {b-c}/[3.000000000,0=/<empty> 1.000000000,0=/<empty>]
rangekey: {c-d}/[5.000000000,0=/<empty> 3.000000000,0=/<empty> 1.000000000,0=/<empty>]
rangekey: {d-f}/[5.000000000,0=/<empty> 1.000000000,0=/<empty>]
rangekey: {f-h}/[5.000000000,0=/<empty> 3.000000000,0={localTs=4.000000000,0}/<empty>]
rangekey: {h-k}/[1.000000000,0=/<empty>]
rangekey: {l-n}/[5.000000000,0=/<empty>]
rangekey: {n-o}/[5.000000000,0=/<empty> 3.000000000,0=/<empty>]
data: "a"/4.000000000,0 -> /<empty>
data: "a"/2.000000000,0 -> /BYTES/a2
data: "b"/4.000000000,0 -> /<empty>
meta: "d"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=7.000000000,0 min=0,0 seq=0} ts=7.000000000,0 del=false klen=12 vlen=7 mergeTs=<nil> txnDidNotUpdateMeta=true
data: "d"/7.000000000,0 -> /BYTES/d7
data: "d"/4.000000000,0 -> /BYTES/d4
data: "d"/2.000000000,0 -> /BYTES/d2
data: "e"/3.000000000,0 -> /BYTES/e3
meta: "f"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=7.000000000,0 min=0,0 seq=0} ts=7.000000000,0 del=false klen=12 vlen=7 mergeTs=<nil> txnDidNotUpdateMeta=true
data: "f"/7.000000000,0 -> /BYTES/f7
data: "f"/6.000000000,0 -> /BYTES/f6
data: "f"/4.000000000,0 -> /BYTES/f4
data: "f"/2.000000000,0 -> /BYTES/f2
data: "g"/4.000000000,0 -> /BYTES/g4
data: "g"/2.000000000,0 -> /BYTES/g2
data: "h"/3.000000000,0 -> /BYTES/h3
meta: "j"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=7.000000000,0 min=0,0 seq=0} ts=7.000000000,0 del=false klen=12 vlen=7 mergeTs=<nil> txnDidNotUpdateMeta=true
data: "j"/7.000000000,0 -> /BYTES/j7
data: "k"/5.000000000,0 -> /BYTES/k5

# Run gets for all keys at all timestamps, with tombstones and intents.
run ok
get k=a ts=1 tombstones inconsistent
get k=a ts=2 tombstones inconsistent
get k=a ts=3 tombstones inconsistent
get k=a ts=4 tombstones inconsistent
get k=a ts=5 tombstones inconsistent
----
get: "a" -> /<empty> @1.000000000,0
get: "a" -> /BYTES/a2 @2.000000000,0
get: "a" -> /BYTES/a2 @2.000000000,0
get: "a" -> /<empty> @4.000000000,0
get: "a" -> /<empty> @4.000000000,0

run ok
get k=b ts=1 tombstones inconsistent
get k=b ts=2 tombstones inconsistent
get k=b ts=3 tombstones inconsistent
get k=b ts=4 tombstones inconsistent
get k=b ts=5 tombstones inconsistent
----
get: "b" -> /<empty> @1.000000000,0
get: "b" -> /<empty> @1.000000000,0
get: "b" -> /<empty> @3.000000000,0
get: "b" -> /<empty> @4.000000000,0
get: "b" -> /<empty> @4.000000000,0

run ok
get k=c ts=1 tombstones inconsistent
get k=c ts=2 tombstones inconsistent
get k=c ts=3 tombstones inconsistent
get k=c ts=4 tombstones inconsistent
get k=c ts=5 tombstones inconsistent
get k=c ts=6 tombstones inconsistent
----
get: "c" -> /<empty> @1.000000000,0
get: "c" -> /<empty> @1.000000000,0
get: "c" -> /<empty> @3.000000000,0
get: "c" -> /<empty> @3.000000000,0
get: "c" -> /<empty> @5.000000000,0
get: "c" -> /<empty> @5.000000000,0

run ok
get k=d ts=1 tombstones inconsistent
get k=d ts=2 tombstones inconsistent
get k=d ts=3 tombstones inconsistent
get k=d ts=4 tombstones inconsistent
get k=d ts=5 tombstones inconsistent
get k=d ts=6 tombstones inconsistent
get k=d ts=7 tombstones inconsistent
get k=d ts=8 tombstones inconsistent
----
get: "d" -> /<empty> @1.000000000,0
get: "d" -> /BYTES/d2 @2.000000000,0
get: "d" -> /BYTES/d2 @2.000000000,0
get: "d" -> /BYTES/d4 @4.000000000,0
get: "d" -> /<empty> @5.000000000,0
get: "d" -> /<empty> @5.000000000,0
get: "d" -> intent {id=00000000 key=/Min pri=0.00000000 epo=0 ts=7.000000000,0 min=0,0 seq=0}
get: "d" -> /<empty> @5.000000000,0
get: "d" -> intent {id=00000000 key=/Min pri=0.00000000 epo=0 ts=7.000000000,0 min=0,0 seq=0}
get: "d" -> /<empty> @5.000000000,0

run ok
get k=e ts=1 tombstones inconsistent
get k=e ts=2 tombstones inconsistent
get k=e ts=3 tombstones inconsistent
get k=e ts=4 tombstones inconsistent
get k=e ts=5 tombstones inconsistent
get k=e ts=6 tombstones inconsistent
----
get: "e" -> /<empty> @1.000000000,0
get: "e" -> /<empty> @1.000000000,0
get: "e" -> /BYTES/e3 @3.000000000,0
get: "e" -> /BYTES/e3 @3.000000000,0
get: "e" -> /<empty> @5.000000000,0
get: "e" -> /<empty> @5.000000000,0

run ok
get k=f ts=1 tombstones inconsistent
get k=f ts=2 tombstones inconsistent
get k=f ts=3 tombstones inconsistent
get k=f ts=4 tombstones inconsistent
get k=f ts=5 tombstones inconsistent
get k=f ts=6 tombstones inconsistent
get k=f ts=7 tombstones inconsistent
get k=f ts=8 tombstones inconsistent
----
get: "f" -> <no data>
get: "f" -> /BYTES/f2 @2.000000000,0
get: "f" -> /<empty> @3.000000000,0
get: "f" -> /BYTES/f4 @4.000000000,0
get: "f" -> /<empty> @5.000000000,0
get: "f" -> /BYTES/f6 @6.000000000,0
get: "f" -> intent {id=00000000 key=/Min pri=0.00000000 epo=0 ts=7.000000000,0 min=0,0 seq=0}
get: "f" -> /BYTES/f6 @6.000000000,0
get: "f" -> intent {id=00000000 key=/Min pri=0.00000000 epo=0 ts=7.000000000,0 min=0,0 seq=0}
get: "f" -> /BYTES/f6 @6.000000000,0

run ok
get k=g ts=1 tombstones inconsistent
get k=g ts=2 tombstones inconsistent
get k=g ts=3 tombstones inconsistent
get k=g ts=4 tombstones inconsistent
get k=g ts=5 tombstones inconsistent
get k=g ts=6 tombstones inconsistent
----
get: "g" -> <no data>
get: "g" -> /BYTES/g2 @2.000000000,0
get: "g" -> /<empty> @3.000000000,0
get: "g" -> /BYTES/g4 @4.000000000,0
get: "g" -> /<empty> @5.000000000,0
get: "g" -> /<empty> @5.000000000,0

run ok
get k=h ts=1 tombstones inconsistent
get k=h ts=2 tombstones inconsistent
get k=h ts=3 tombstones inconsistent
get k=h ts=4 tombstones inconsistent
get k=h ts=5 tombstones inconsistent
get k=h ts=6 tombstones inconsistent
----
get: "h" -> /<empty> @1.000000000,0
get: "h" -> /<empty> @1.000000000,0
get: "h" -> /BYTES/h3 @3.000000000,0
get: "h" -> /BYTES/h3 @3.000000000,0
get: "h" -> /BYTES/h3 @3.000000000,0
get: "h" -> /BYTES/h3 @3.000000000,0

run ok
get k=i ts=1 tombstones inconsistent
get k=i ts=2 tombstones inconsistent
----
get: "i" -> /<empty> @1.000000000,0
get: "i" -> /<empty> @1.000000000,0

run ok
get k=j ts=1 tombstones inconsistent
get k=j ts=2 tombstones inconsistent
get k=j ts=6 tombstones inconsistent
get k=j ts=7 tombstones inconsistent
get k=j ts=8 tombstones inconsistent
----
get: "j" -> /<empty> @1.000000000,0
get: "j" -> /<empty> @1.000000000,0
get: "j" -> /<empty> @1.000000000,0
get: "j" -> intent {id=00000000 key=/Min pri=0.00000000 epo=0 ts=7.000000000,0 min=0,0 seq=0}
get: "j" -> /<empty> @1.000000000,0
get: "j" -> intent {id=00000000 key=/Min pri=0.00000000 epo=0 ts=7.000000000,0 min=0,0 seq=0}
get: "j" -> /<empty> @1.000000000,0

run ok
get k=k ts=4 tombstones inconsistent
get k=k ts=5 tombstones inconsistent
get k=k ts=6 tombstones inconsistent
----
get: "k" -> <no data>
get: "k" -> /BYTES/k5 @5.000000000,0
get: "k" -> /BYTES/k5 @5.000000000,0

run ok
get k=l ts=4 tombstones inconsistent
get k=l ts=5 tombstones inconsistent
get k=l ts=6 tombstones inconsistent
----
get: "l" -> <no data>
get: "l" -> /<empty> @5.000000000,0
get: "l" -> /<empty> @5.000000000,0

run ok
get k=m ts=4 tombstones inconsistent
get k=m ts=5 tombstones inconsistent
get k=m ts=6 tombstones inconsistent
----
get: "m" -> <no data>
get: "m" -> /<empty> @5.000000000,0
get: "m" -> /<empty> @5.000000000,0

run ok
get k=n ts=2 tombstones inconsistent
get k=n ts=3 tombstones inconsistent
get k=n ts=4 tombstones inconsistent
get k=n ts=5 tombstones inconsistent
get k=n ts=6 tombstones inconsistent
----
get: "n" -> <no data>
get: "n" -> /<empty> @3.000000000,0
get: "n" -> /<empty> @3.000000000,0
get: "n" -> /<empty> @5.000000000,0
get: "n" -> /<empty> @5.000000000,0

run ok
get k=o ts=2 tombstones inconsistent
get k=o ts=3 tombstones inconsistent
get k=o ts=4 tombstones inconsistent
get k=o ts=5 tombstones inconsistent
get k=o ts=6 tombstones inconsistent
----
get: "o" -> <no data>
get: "o" -> <no data>
get: "o" -> <no data>
get: "o" -> <no data>
get: "o" -> <no data>
Loading

0 comments on commit d0e02db

Please sign in to comment.