github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/kv/kvserver/concurrency/testdata/lock_table/disable (about) 1 new-lock-table maxlocks=10000 2 ---- 3 4 new-txn txn=txn1 ts=10,1 epoch=0 5 ---- 6 7 new-txn txn=txn2 ts=10,1 epoch=0 8 ---- 9 10 # ------------------------------------------------------------- 11 # Disable the lock-table - the replica may have lost the lease 12 # or may be being merged away. It should not be possible to add 13 # a lock to the lock-table. 14 # NOTE: the clear functionality itself is already tested in 15 # testdata/clear. 16 # ------------------------------------------------------------- 17 18 clear disable 19 ---- 20 global: num=0 21 local: num=0 22 23 new-request r=req1 txn=txn1 ts=10,1 spans=w@a+w@c 24 ---- 25 26 scan r=req1 27 ---- 28 start-waiting: false 29 30 guard-state r=req1 31 ---- 32 new: state=doneWaiting 33 34 add-discovered r=req1 k=a txn=txn2 35 ---- 36 global: num=0 37 local: num=0 38 39 # NOTE: this won't end up in an infinite loop of scanning a disabled 40 # lock-table and discovering but ignoring the same lock in practice 41 # because the second pass through evaluation is likely to hit a 42 # NotLeaseholderError, bouncing the request back to the client. 43 44 scan r=req1 45 ---- 46 start-waiting: false 47 48 acquire r=req1 k=c durability=u 49 ---- 50 global: num=0 51 local: num=0 52 53 dequeue r=req1 54 ---- 55 global: num=0 56 local: num=0 57 58 # ------------------------------------------------------------- 59 # Enable the lock-table - the behavior should return to normal. 60 # ------------------------------------------------------------- 61 62 enable 63 ---- 64 65 new-request r=req2 txn=txn1 ts=10,1 spans=w@a+w@c 66 ---- 67 68 scan r=req2 69 ---- 70 start-waiting: false 71 72 guard-state r=req2 73 ---- 74 new: state=doneWaiting 75 76 add-discovered r=req2 k=a txn=txn2 77 ---- 78 global: num=1 79 lock: "a" 80 holder: txn: 00000000-0000-0000-0000-000000000002, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0] 81 queued writers: 82 active: false req: 2, txn: 00000000-0000-0000-0000-000000000001 83 local: num=0 84 85 scan r=req2 86 ---- 87 start-waiting: true 88 89 guard-state r=req2 90 ---- 91 new: state=waitForDistinguished txn=txn2 key="a" held=true guard-access=write 92 93 release txn=txn2 span=a 94 ---- 95 global: num=1 96 lock: "a" 97 res: req: 2, txn: 00000000-0000-0000-0000-000000000001, ts: 0.000000010,1, seq: 0 98 local: num=0 99 100 guard-state r=req2 101 ---- 102 new: state=doneWaiting 103 104 acquire r=req2 k=c durability=u 105 ---- 106 global: num=2 107 lock: "a" 108 res: req: 2, txn: 00000000-0000-0000-0000-000000000001, ts: 0.000000010,1, seq: 0 109 lock: "c" 110 holder: txn: 00000000-0000-0000-0000-000000000001, ts: 0.000000010,1, info: unrepl epoch: 0, seqs: [0] 111 local: num=0 112 113 dequeue r=req2 114 ---- 115 global: num=1 116 lock: "c" 117 holder: txn: 00000000-0000-0000-0000-000000000001, ts: 0.000000010,1, info: unrepl epoch: 0, seqs: [0] 118 local: num=0