# -------------------------------------------------------------
# A scan finds 10 intents that it can push from same txn.
# -------------------------------------------------------------

new-txn name=txn1 ts=10,1 epoch=0 priority=high
----

new-txn name=txn2 ts=10,1 epoch=0
----

new-txn name=txn3 ts=10,1 epoch=0
----

new-request name=req1 txn=txn1 ts=10,1
  scan key=a endkey=z
----

sequence req=req1
----
[1] sequence req1: sequencing request
[1] sequence req1: acquiring latches
[1] sequence req1: scanning lock table for conflicting locks
[1] sequence req1: sequencing complete, returned guard

handle-lock-conflict-error req=req1 lease-seq=1
  lock txn=txn2 key=a
  lock txn=txn2 key=b
  lock txn=txn2 key=c
  lock txn=txn2 key=d
  lock txn=txn2 key=e
  lock txn=txn2 key=f
  lock txn=txn2 key=g
  lock txn=txn2 key=h
  lock txn=txn2 key=i
  lock txn=txn2 key=j
----
[2] handle lock conflict error req1: handled conflicting locks on ‹"a"›, ‹"b"›, ‹"c"›, ‹"d"›, ‹"e"›, ‹"f"›, ‹"g"›, ‹"h"›, ‹"i"›, ‹"j"›, released latches

debug-lock-table
----
num=10
 lock: "a"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "b"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "c"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "d"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "e"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "f"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "g"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "h"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "i"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "j"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]

# Before re-scanning and pushing, add a waiter on a single key to demonstrate
# that uncontended, replicated keys are released when pushed, while contended,
# replicated keys are not. We use a shared locking waiter here so that our high
# priority scan doesn't conflict on latches with it (once the replicated lock
# stops being tracked).
new-request name=req2 txn=txn3 ts=10,1
  get key=c str=shared
----

sequence req=req2
----
[3] sequence req2: sequencing request
[3] sequence req2: acquiring latches
[3] sequence req2: scanning lock table for conflicting locks
[3] sequence req2: waiting in lock wait-queues
[3] sequence req2: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"c"› (queuedLockingRequests: 1, queuedReaders: 0)
[3] sequence req2: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = false, wait policy error = false
[3] sequence req2: pushing txn 00000002 to abort
[3] sequence req2: blocked on select in concurrency_test.(*cluster).PushTransaction

# Now re-scan with the high-priority reader.
sequence req=req1
----
[3] sequence req2: lock wait-queue event: done waiting
[3] sequence req2: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"c"› for 0.000s
[3] sequence req2: acquiring latches
[3] sequence req2: scanning lock table for conflicting locks
[3] sequence req2: sequencing complete, returned guard
[4] sequence req1: re-sequencing request
[4] sequence req1: acquiring latches
[4] sequence req1: scanning lock table for conflicting locks
[4] sequence req1: waiting in lock wait-queues
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"a"› (queuedLockingRequests: 0, queuedReaders: 1)
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: pusher pushed pushee to 10.000000000,2
[4] sequence req1: resolving intent ‹"a"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,2}
[4] sequence req1: lock wait-queue event: done waiting
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"a"› for 0.000s
[4] sequence req1: resolving a batch of 9 intent(s)
[4] sequence req1: resolving intent ‹"b"› for txn 00000002 with PENDING status
[4] sequence req1: resolving intent ‹"c"› for txn 00000002 with PENDING status
[4] sequence req1: resolving intent ‹"d"› for txn 00000002 with PENDING status
[4] sequence req1: resolving intent ‹"e"› for txn 00000002 with PENDING status
[4] sequence req1: resolving intent ‹"f"› for txn 00000002 with PENDING status
[4] sequence req1: resolving intent ‹"g"› for txn 00000002 with PENDING status
[4] sequence req1: resolving intent ‹"h"› for txn 00000002 with PENDING status
[4] sequence req1: resolving intent ‹"i"› for txn 00000002 with PENDING status
[4] sequence req1: resolving intent ‹"j"› for txn 00000002 with PENDING status
[4] sequence req1: acquiring latches
[4] sequence req1: scanning lock table for conflicting locks
[4] sequence req1: sequencing complete, returned guard

finish req=req1
----
[-] finish req1: finishing request

handle-lock-conflict-error req=req2 lease-seq=1
  lock txn=txn2 key=c
----
[5] handle lock conflict error req2: handled conflicting locks on ‹"c"›, released latches

# Only the contended lock remains.
debug-lock-table
----
num=1
 lock: "c"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
   queued locking requests:
    active: false req: 2, strength: Shared, txn: 00000003-0000-0000-0000-000000000000

sequence req=req2
----
[6] sequence req2: re-sequencing request
[6] sequence req2: acquiring latches
[6] sequence req2: scanning lock table for conflicting locks
[6] sequence req2: waiting in lock wait-queues
[6] sequence req2: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"c"› (queuedLockingRequests: 1, queuedReaders: 0)
[6] sequence req2: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = false, wait policy error = false
[6] sequence req2: pushing txn 00000002 to abort
[6] sequence req2: blocked on select in concurrency_test.(*cluster).PushTransaction

on-txn-updated txn=txn2 status=aborted
----
[-] update txn: aborting txn2
[6] sequence req2: resolving intent ‹"c"› for txn 00000002 with ABORTED status
[6] sequence req2: lock wait-queue event: done waiting
[6] sequence req2: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"c"› for 0.000s
[6] sequence req2: acquiring latches
[6] sequence req2: scanning lock table for conflicting locks
[6] sequence req2: sequencing complete, returned guard

finish req=req2
----
[-] finish req2: finishing request

reset namespace
----

# ---------------------------------------------------------------------------
# A scan finds 2 intents and 2 unreplicated locks from the same txn. When the
# txn is pushed, only the 2 intents need to be resolved, since it is sufficient
# to advance the timestamp of the unreplicated locks in the lock table directly.
# ---------------------------------------------------------------------------

new-txn name=txn1 ts=10,1 epoch=0 priority=high
----

new-txn name=txn2 ts=10,1 epoch=0
----

new-request name=req1 txn=txn1 ts=10,1
  scan key=a endkey=z
----

sequence req=req1
----
[1] sequence req1: sequencing request
[1] sequence req1: acquiring latches
[1] sequence req1: scanning lock table for conflicting locks
[1] sequence req1: sequencing complete, returned guard

handle-lock-conflict-error req=req1 lease-seq=1
  lock txn=txn2 key=a
  lock txn=txn2 key=b
----
[2] handle lock conflict error req1: handled conflicting locks on ‹"a"›, ‹"b"›, released latches

debug-lock-table
----
num=2
 lock: "a"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "b"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]

new-request name=req2 txn=txn2 ts=10,1
  put key=g value=v1
  put key=h value=v2
----

sequence req=req2
----
[3] sequence req2: sequencing request
[3] sequence req2: acquiring latches
[3] sequence req2: scanning lock table for conflicting locks
[3] sequence req2: sequencing complete, returned guard

on-lock-acquired req=req2 key=g dur=u
----
[-] acquire lock: txn 00000002 @ ‹g›

on-lock-acquired req=req2 key=h dur=u
----
[-] acquire lock: txn 00000002 @ ‹h›

finish req=req2
----
[-] finish req2: finishing request

debug-lock-table
----
num=4
 lock: "a"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "b"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "g"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: unrepl [(str: Exclusive seq: 0)]
 lock: "h"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: unrepl [(str: Exclusive seq: 0)]

sequence req=req1
----
[4] sequence req1: re-sequencing request
[4] sequence req1: acquiring latches
[4] sequence req1: scanning lock table for conflicting locks
[4] sequence req1: waiting in lock wait-queues
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"a"› (queuedLockingRequests: 0, queuedReaders: 1)
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: pusher pushed pushee to 10.000000000,2
[4] sequence req1: resolving intent ‹"a"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,5}
[4] sequence req1: lock wait-queue event: done waiting
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"a"› for 0.000s
[4] sequence req1: resolving a batch of 1 intent(s)
[4] sequence req1: resolving intent ‹"b"› for txn 00000002 with PENDING status
[4] sequence req1: acquiring latches
[4] sequence req1: scanning lock table for conflicting locks
[4] sequence req1: sequencing complete, returned guard

finish req=req1
----
[-] finish req1: finishing request

debug-lock-table
----
num=2
 lock: "g"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,2, info: unrepl [(str: Exclusive seq: 0)]
 lock: "h"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,2, info: unrepl [(str: Exclusive seq: 0)]

reset namespace
----

# -------------------------------------------------------------
# A scan with an uncertainty interval does not defer resolution
# of pushed intents. Instead, it pushes and resolves intents one
# by one. This is a limitation.
# -------------------------------------------------------------

new-txn name=txn1 ts=10,1 epoch=0 priority=high uncertainty-limit=11,1
----

new-txn name=txn2 ts=10,1 epoch=0
----

new-request name=req1 txn=txn1 ts=10,1
  scan key=a endkey=z
----

sequence req=req1
----
[1] sequence req1: sequencing request
[1] sequence req1: acquiring latches
[1] sequence req1: scanning lock table for conflicting locks
[1] sequence req1: sequencing complete, returned guard

handle-lock-conflict-error req=req1 lease-seq=1
  lock txn=txn2 key=a
  lock txn=txn2 key=b
  lock txn=txn2 key=c
----
[2] handle lock conflict error req1: handled conflicting locks on ‹"a"›, ‹"b"›, ‹"c"›, released latches

debug-lock-table
----
num=3
 lock: "a"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "b"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "c"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]

sequence req=req1
----
[3] sequence req1: re-sequencing request
[3] sequence req1: acquiring latches
[3] sequence req1: scanning lock table for conflicting locks
[3] sequence req1: waiting in lock wait-queues
[3] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"a"› (queuedLockingRequests: 0, queuedReaders: 1)
[3] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[3] sequence req1: pushing timestamp of txn 00000002 above 11.000000000,1
[3] sequence req1: pusher pushed pushee to 11.000000000,2
[3] sequence req1: resolving intent ‹"a"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,7}
[3] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"b"› (queuedLockingRequests: 0, queuedReaders: 1)
[3] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"a"› for 0.000s
[3] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[3] sequence req1: pushing timestamp of txn 00000002 above 11.000000000,1
[3] sequence req1: resolving intent ‹"b"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,9}
[3] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"c"› (queuedLockingRequests: 0, queuedReaders: 1)
[3] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"b"› for 0.000s
[3] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[3] sequence req1: pushing timestamp of txn 00000002 above 11.000000000,1
[3] sequence req1: resolving intent ‹"c"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,11}
[3] sequence req1: lock wait-queue event: done waiting
[3] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"c"› for 0.000s
[3] sequence req1: acquiring latches
[3] sequence req1: scanning lock table for conflicting locks
[3] sequence req1: sequencing complete, returned guard

finish req=req1
----
[-] finish req1: finishing request

debug-lock-table
----
num=0

reset namespace
----

# -------------------------------------------------------------------------
# The kv.lock_table.batch_pushed_lock_resolution.enabled cluster setting can
# be used to disable deferred lock resolution of pushed intents.
# -------------------------------------------------------------------------

debug-set-batch-pushed-lock-resolution-enabled ok=false
----

new-txn name=txn1 ts=10,1 epoch=0 priority=high
----

new-txn name=txn2 ts=10,1 epoch=0
----

new-txn name=txn3 ts=10,1 epoch=0
----

new-request name=req1 txn=txn1 ts=10,1
  scan key=a endkey=z
----

sequence req=req1
----
[1] sequence req1: sequencing request
[1] sequence req1: acquiring latches
[1] sequence req1: scanning lock table for conflicting locks
[1] sequence req1: sequencing complete, returned guard

handle-lock-conflict-error req=req1 lease-seq=1
  lock txn=txn2 key=a
  lock txn=txn2 key=b
  lock txn=txn2 key=c
  lock txn=txn2 key=d
  lock txn=txn2 key=e
  lock txn=txn2 key=f
  lock txn=txn2 key=g
  lock txn=txn2 key=h
  lock txn=txn2 key=i
  lock txn=txn2 key=j
----
[2] handle lock conflict error req1: handled conflicting locks on ‹"a"›, ‹"b"›, ‹"c"›, ‹"d"›, ‹"e"›, ‹"f"›, ‹"g"›, ‹"h"›, ‹"i"›, ‹"j"›, released latches

debug-lock-table
----
num=10
 lock: "a"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "b"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "c"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "d"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "e"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "f"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "g"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "h"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "i"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
 lock: "j"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]

# Before re-scanning and pushing, add a waiter on a single key to demonstrate
# that uncontended, replicated keys are released when pushed, while contended,
# replicated keys are not. We use a shared locking waiter here so that our high
# priority scan doesn't conflict on latches with it (once the replicated lock
# stops being tracked).
new-request name=req2 txn=txn3 ts=10,1
  get key=c str=shared
----

sequence req=req2
----
[3] sequence req2: sequencing request
[3] sequence req2: acquiring latches
[3] sequence req2: scanning lock table for conflicting locks
[3] sequence req2: waiting in lock wait-queues
[3] sequence req2: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"c"› (queuedLockingRequests: 1, queuedReaders: 0)
[3] sequence req2: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = false, wait policy error = false
[3] sequence req2: pushing txn 00000002 to abort
[3] sequence req2: blocked on select in concurrency_test.(*cluster).PushTransaction

# Now re-scan with the high-priority reader.
sequence req=req1
----
[3] sequence req2: lock wait-queue event: done waiting
[3] sequence req2: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"c"› for 0.000s
[3] sequence req2: acquiring latches
[3] sequence req2: scanning lock table for conflicting locks
[3] sequence req2: sequencing complete, returned guard
[4] sequence req1: re-sequencing request
[4] sequence req1: acquiring latches
[4] sequence req1: scanning lock table for conflicting locks
[4] sequence req1: waiting in lock wait-queues
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"a"› (queuedLockingRequests: 0, queuedReaders: 1)
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: pusher pushed pushee to 10.000000000,2
[4] sequence req1: resolving intent ‹"a"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,14}
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"b"› (queuedLockingRequests: 0, queuedReaders: 1)
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"a"› for 0.000s
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: resolving intent ‹"b"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,16}
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"c"› (queuedLockingRequests: 1, queuedReaders: 1)
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"b"› for 0.000s
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: resolving intent ‹"c"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,18}
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"d"› (queuedLockingRequests: 0, queuedReaders: 1)
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"c"› for 0.000s
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: resolving intent ‹"d"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,20}
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"e"› (queuedLockingRequests: 0, queuedReaders: 1)
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"d"› for 0.000s
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: resolving intent ‹"e"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,22}
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"f"› (queuedLockingRequests: 0, queuedReaders: 1)
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"e"› for 0.000s
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: resolving intent ‹"f"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,24}
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"g"› (queuedLockingRequests: 0, queuedReaders: 1)
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"f"› for 0.000s
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: resolving intent ‹"g"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,26}
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"h"› (queuedLockingRequests: 0, queuedReaders: 1)
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"g"› for 0.000s
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: resolving intent ‹"h"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,28}
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"i"› (queuedLockingRequests: 0, queuedReaders: 1)
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"h"› for 0.000s
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: resolving intent ‹"i"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,30}
[4] sequence req1: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"j"› (queuedLockingRequests: 0, queuedReaders: 1)
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"i"› for 0.000s
[4] sequence req1: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = true, wait policy error = false
[4] sequence req1: pushing timestamp of txn 00000002 above 10.000000000,1
[4] sequence req1: resolving intent ‹"j"› for txn 00000002 with PENDING status and clock observation {1 123.000000000,32}
[4] sequence req1: lock wait-queue event: done waiting
[4] sequence req1: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"j"› for 0.000s
[4] sequence req1: acquiring latches
[4] sequence req1: scanning lock table for conflicting locks
[4] sequence req1: sequencing complete, returned guard

finish req=req1
----
[-] finish req1: finishing request

handle-lock-conflict-error req=req2 lease-seq=1
  lock txn=txn2 key=c
----
[5] handle lock conflict error req2: handled conflicting locks on ‹"c"›, released latches

# Only the contended lock remains.
debug-lock-table
----
num=1
 lock: "c"
  holder: txn: 00000002-0000-0000-0000-000000000000 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent]
   queued locking requests:
    active: false req: 7, strength: Shared, txn: 00000003-0000-0000-0000-000000000000

sequence req=req2
----
[6] sequence req2: re-sequencing request
[6] sequence req2: acquiring latches
[6] sequence req2: scanning lock table for conflicting locks
[6] sequence req2: waiting in lock wait-queues
[6] sequence req2: lock wait-queue event: wait for txn 00000002 holding lock @ key ‹"c"› (queuedLockingRequests: 1, queuedReaders: 0)
[6] sequence req2: pushing after 0s for: deadlock/liveness detection = true, timeout enforcement = false, priority enforcement = false, wait policy error = false
[6] sequence req2: pushing txn 00000002 to abort
[6] sequence req2: blocked on select in concurrency_test.(*cluster).PushTransaction

on-txn-updated txn=txn2 status=aborted
----
[-] update txn: aborting txn2
[6] sequence req2: resolving intent ‹"c"› for txn 00000002 with ABORTED status
[6] sequence req2: lock wait-queue event: done waiting
[6] sequence req2: conflicted with ‹00000002-0000-0000-0000-000000000000› on ‹"c"› for 0.000s
[6] sequence req2: acquiring latches
[6] sequence req2: scanning lock table for conflicting locks
[6] sequence req2: sequencing complete, returned guard

finish req=req2
----
[-] finish req2: finishing request

reset namespace
----

debug-set-batch-pushed-lock-resolution-enabled ok=true
----
