# Tests where the same key is in both ReadWrite and ReadOnly spans.

new-lock-table maxlocks=10000
----

# ---------------------------------------------------------------------------------
# Test: req2 accesses "a" as both write and read. Once it has reservation for write
# it does not wait at "a" for read.
# ---------------------------------------------------------------------------------

new-txn txn=txn1 ts=10 epoch=0
----

new-txn txn=txn2 ts=10 epoch=0
----

new-txn txn=txn3 ts=10 epoch=0
----

new-request r=req1 txn=txn1 ts=10 spans=exclusive@a+exclusive@b+exclusive@c
----

scan r=req1
----
start-waiting: false

acquire r=req1 k=a durability=u strength=exclusive
----
num=1
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

dequeue r=req1
----
num=1
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

new-request r=req2 txn=txn2 ts=10 spans=intent@a+none@a
----

scan r=req2
----
start-waiting: true

guard-state r=req2
----
new: state=waitFor txn=txn1 key="a" held=true guard-strength=Intent

print
----
num=1
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 2, strength: Intent, txn: 00000000-0000-0000-0000-000000000002

release txn=txn1 span=a
----
num=1
 lock: "a"
   queued locking requests:
    active: false req: 2, strength: Intent, txn: 00000000-0000-0000-0000-000000000002

guard-state r=req2
----
new: state=doneWaiting

dequeue r=req2
----
num=0

# ---------------------------------------------------------------------------------
# Test: req5 accesses "b" as both write and read. It has its reservation at "b"
# broken, but ignores "b" when encounters it as reader.
# ---------------------------------------------------------------------------------

new-request r=req3 txn=txn1 ts=10 spans=exclusive@a+exclusive@b+exclusive@c
----

scan r=req3
----
start-waiting: false

acquire r=req3 k=a durability=u strength=exclusive
----
num=1
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

acquire r=req3 k=b durability=u strength=exclusive
----
num=2
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

acquire r=req3 k=c durability=u strength=exclusive
----
num=3
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

dequeue r=req3
----
num=3
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

new-request r=req4 txn=txn2 ts=10 spans=intent@a+intent@b
----

scan r=req4
----
start-waiting: true

guard-state r=req4
----
new: state=waitFor txn=txn1 key="a" held=true guard-strength=Intent

new-request r=req5 txn=txn3 ts=10 spans=intent@b+intent@c+none@b
----

scan r=req5
----
start-waiting: true

guard-state r=req5
----
new: state=waitFor txn=txn1 key="b" held=true guard-strength=Intent

print
----
num=3
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 4, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

# req5 reserves "b" and waits at "c".

release txn=txn1 span=b
----
num=3
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 4, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

guard-state r=req5
----
new: state=waitFor txn=txn1 key="c" held=true guard-strength=Intent

print
----
num=3
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 4, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

# req4 breaks the reservation of req4 at "b".

release txn=txn1 span=a
----
num=3
 lock: "a"
   queued locking requests:
    active: false req: 4, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

guard-state r=req4
----
new: state=doneWaiting

print
----
num=3
 lock: "a"
   queued locking requests:
    active: false req: 4, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 4, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
    active: false req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

query span=a,d
----
num locks: 1, bytes returned: 73, resume reason: RESUME_UNKNOWN, resume span: <nil>
 locks:
  range_id=3 key="c" holder=00000000-0000-0000-0000-000000000001 durability=Unreplicated duration=0s
   waiters:
    waiting_txn:00000000-0000-0000-0000-000000000003 active_waiter:true strength:Exclusive wait_duration:0s

# req5 encounters the reservation by req4 at "b" when looking at it for its read access, but ignores
# it.
release txn=txn1 span=c
----
num=3
 lock: "a"
   queued locking requests:
    active: false req: 4, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 4, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
    active: false req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003
 lock: "c"
   queued locking requests:
    active: false req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

guard-state r=req5
----
new: state=doneWaiting

scan r=req5
----
start-waiting: true

print
----
num=3
 lock: "a"
   queued locking requests:
    active: false req: 4, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 4, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
    active: true req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003
 lock: "c"
   queued locking requests:
    active: false req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

dequeue r=req4
----
num=2
 lock: "b"
   queued locking requests:
    active: false req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003
 lock: "c"
   queued locking requests:
    active: false req: 5, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

dequeue r=req5
----
num=0

print
----
num=0

# ---------------------------------------------------------------------------------
# Test: Non-transactional req8 accesses "b" as both write and read. After it has stopped waiting
# at "b", the reservation for "b" is acquired by a request with a lower seqnum. req8 does not ignore
# "b" when encountering it as a reader. This is the non-transactional request version of the
# previous test.
# ---------------------------------------------------------------------------------

new-request r=req6 txn=txn1 ts=10 spans=exclusive@a+exclusive@b+exclusive@c
----

scan r=req6
----
start-waiting: false

acquire r=req6 k=a durability=u strength=exclusive
----
num=1
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

acquire r=req6 k=b durability=u strength=exclusive
----
num=2
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

acquire r=req6 k=c durability=u strength=exclusive strength=exclusive
----
num=3
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

dequeue r=req6
----
num=3
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

new-request r=req7 txn=txn2 ts=10 spans=exclusive@a+exclusive@b
----

scan r=req7
----
start-waiting: true

guard-state r=req7
----
new: state=waitFor txn=txn1 key="a" held=true guard-strength=Exclusive

new-request r=req8 txn=none ts=10 spans=intent@b+intent@c+none@b
----

scan r=req8
----
start-waiting: true

guard-state r=req8
----
new: state=waitFor txn=txn1 key="b" held=true guard-strength=Intent

# req9 is just to prevent the lock for "b" from being gc'd and then a new one
# created when req7 acquires "b", which due to the old snapshot held by req8
# would not be seen until the next scan.
new-request r=req9 txn=txn2 ts=10 spans=intent@b
----

scan r=req9
----
start-waiting: true

guard-state r=req9
----
new: state=waitFor txn=txn1 key="b" held=true guard-strength=Intent

print
----
num=3
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 7, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 8, strength: Intent, txn: none
    active: true req: 9, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

# req8 waits at "c".

release txn=txn1 span=b
----
num=3
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 7, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 9, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

guard-state r=req8
----
new: state=waitFor txn=txn1 key="c" held=true guard-strength=Intent

print
----
num=3
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 7, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 9, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 8, strength: Intent, txn: none

# req7 is doneWaiting and proceeds to acquire the lock at "b".

release txn=txn1 span=a
----
num=3
 lock: "a"
   queued locking requests:
    active: false req: 7, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 9, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 8, strength: Intent, txn: none

guard-state r=req7
----
new: state=doneWaiting

print
----
num=3
 lock: "a"
   queued locking requests:
    active: false req: 7, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 7, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
    active: false req: 9, strength: Intent, txn: 00000000-0000-0000-0000-000000000002
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 8, strength: Intent, txn: none

scan r=req7
----
start-waiting: false

acquire r=req7 k=b durability=u strength=exclusive
----
num=3
 lock: "a"
   queued locking requests:
    active: false req: 7, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000002 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "c"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 8, strength: Intent, txn: none

# req8 encounters the lock held by req7 at "b" when looking at it for its read access.
release txn=txn1 span=c
----
num=2
 lock: "a"
   queued locking requests:
    active: false req: 7, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000002 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

guard-state r=req8
----
new: state=waitFor txn=txn2 key="b" held=true guard-strength=None

print
----
num=2
 lock: "a"
   queued locking requests:
    active: false req: 7, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000002 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   waiting readers:
    req: 8, txn: none

dequeue r=req7
----
num=1
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000002 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   waiting readers:
    req: 8, txn: none

dequeue r=req8
----
num=1
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000002 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

release txn=txn2 span=b
----
num=0

# ---------------------------------------------------------------------------------
# Test: req12 accesses "b" as both write and read. It has its reservation at "b"
# broken, and the lock is acquired at "b" before it encounters "b" as reader, but
# it ignores the lock at "b".
# ---------------------------------------------------------------------------------

new-request r=req10 txn=txn1 ts=10 spans=exclusive@a+exclusive@b
----

scan r=req10
----
start-waiting: false

acquire r=req10 k=a durability=u strength=exclusive
----
num=1
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

acquire r=req10 k=b durability=u strength=exclusive
----
num=2
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

dequeue r=req10
----
num=2
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

new-request r=req11 txn=txn2 ts=10 spans=exclusive@a+exclusive@b
----

scan r=req11
----
start-waiting: true

guard-state r=req11
----
new: state=waitFor txn=txn1 key="a" held=true guard-strength=Exclusive

new-request r=req12 txn=txn3 ts=10 spans=intent@b+none@b
----

scan r=req12
----
start-waiting: true

guard-state r=req12
----
new: state=waitFor txn=txn1 key="b" held=true guard-strength=Intent

print
----
num=2
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 11, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 12, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

# req12 reserves "b".

release txn=txn1 span=b
----
num=2
 lock: "a"
  holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 11, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 12, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

# req11 reserves "a"
release txn=txn1 span=a
----
num=2
 lock: "a"
   queued locking requests:
    active: false req: 11, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 12, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

# req11 breaks the reservation at "b"
guard-state r=req11
----
new: state=doneWaiting

print
----
num=2
 lock: "a"
   queued locking requests:
    active: false req: 11, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
   queued locking requests:
    active: false req: 11, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
    active: false req: 12, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

scan r=req11
----
start-waiting: false

acquire r=req11 k=b durability=u strength=exclusive
----
num=2
 lock: "a"
   queued locking requests:
    active: false req: 11, strength: Exclusive, txn: 00000000-0000-0000-0000-000000000002
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000002 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: false req: 12, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

# req12 ignores the lock at "b" when it encounters it again as a reader. So it will
# enter the doneWaiting state. It will wait again when it rescans.

guard-state r=req12
----
new: state=doneWaiting

scan r=req12
----
start-waiting: true

guard-state r=req12
----
new: state=waitFor txn=txn2 key="b" held=true guard-strength=Intent

dequeue r=req11
----
num=1
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000002 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]
   queued locking requests:
    active: true req: 12, strength: Intent, txn: 00000000-0000-0000-0000-000000000003

dequeue r=req12
----
num=1
 lock: "b"
  holder: txn: 00000000-0000-0000-0000-000000000002 epoch: 0, iso: Serializable, ts: 10.000000000,0, info: unrepl [(str: Exclusive seq: 0)]

release txn=txn2 span=b
-----

print
----
num=0
