From 54d50fe0d336b643482a42571c7879a17927d9ce Mon Sep 17 00:00:00 2001 From: Arul Ajmani Date: Thu, 4 May 2023 11:58:55 -0400 Subject: [PATCH] concurrency: correctly print guard-state in lock table tests Followup from #102647. In that patch, we decided to translate the strength field on a lock table guard back to a `SpanAccess` to defer some test churn. This patch addresses that TODO; it's entirely mechanical. Informs: #102008 Release note: None --- .../kvserver/concurrency/lock_table_test.go | 17 +-------- .../testdata/lock_table/add_discovered | 4 +- .../concurrency/testdata/lock_table/basic | 38 +++++++++---------- .../concurrency/testdata/lock_table/clear | 6 +-- .../lock_table/clear_finalized_txn_locks | 12 +++--- .../concurrency/testdata/lock_table/disable | 2 +- .../discovered_locks_consults_txn_cache | 2 +- .../testdata/lock_table/dup_access | 24 ++++++------ .../testdata/lock_table/lock_changes | 8 ++-- .../testdata/lock_table/lock_dropped | 6 +-- .../testdata/lock_table/non_active_waiter | 6 +-- .../testdata/lock_table/non_txn_write | 8 ++-- .../testdata/lock_table/queue_length_exceeded | 10 ++--- .../testdata/lock_table/size_limit_exceeded | 6 +-- .../concurrency/testdata/lock_table/update | 10 ++--- .../concurrency/testdata/lock_table/wait_self | 10 ++--- 16 files changed, 78 insertions(+), 91 deletions(-) diff --git a/pkg/kv/kvserver/concurrency/lock_table_test.go b/pkg/kv/kvserver/concurrency/lock_table_test.go index a76a7a9b05f4..ff48a09523cf 100644 --- a/pkg/kv/kvserver/concurrency/lock_table_test.go +++ b/pkg/kv/kvserver/concurrency/lock_table_test.go @@ -578,21 +578,8 @@ func TestLockTableBasic(t *testing.T) { if txnS == "" { txnS = fmt.Sprintf("unknown txn with ID: %v", state.txn.ID) } - // TODO(arul): We're translating the lock strength back to guardAccess - // for now to reduce test churn. A followup patch should teach these - // datadriven tests to use lock.Strength correctly -- both in its input - // and output. - var sa spanset.SpanAccess - switch state.guardStrength { - case lock.None: - sa = spanset.SpanReadOnly - case lock.Intent: - sa = spanset.SpanReadWrite - default: - t.Fatalf("unexpected guard strength %s", state.guardStrength) - } - return fmt.Sprintf("%sstate=%s txn=%s key=%s held=%t guard-access=%s", - str, typeStr, txnS, state.key, state.held, sa) + return fmt.Sprintf("%sstate=%s txn=%s key=%s held=%t guard-strength=%s", + str, typeStr, txnS, state.key, state.held, state.guardStrength) case "resolve-before-scanning": var reqName string diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/add_discovered b/pkg/kv/kvserver/concurrency/testdata/lock_table/add_discovered index bdaa2f6f9da9..504c82c5438b 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/add_discovered +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/add_discovered @@ -79,7 +79,7 @@ new: state=doneWaiting guard-state r=req3 ---- -new: state=waitForDistinguished txn=txn2 key="a" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=false guard-strength=Intent # -------------------------------- # Setup complete, test starts here @@ -99,7 +99,7 @@ start-waiting: true guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn3 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn3 key="a" held=true guard-strength=Intent guard-state r=req3 ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/basic b/pkg/kv/kvserver/concurrency/testdata/lock_table/basic index 58aa18999e96..79b25dbf2eff 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/basic +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/basic @@ -123,7 +123,7 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="b" held=true guard-strength=Intent # 3s passes while req4 is waiting on locks on b,c time-tick s=3 @@ -145,7 +145,7 @@ num=3 guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn1 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="c" held=true guard-strength=Intent # 1s passes while req4 continues to wait on c (and only has reservation on b) time-tick s=1 @@ -241,7 +241,7 @@ time-tick s=2 guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn3 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn3 key="a" held=true guard-strength=Intent print ---- @@ -537,7 +537,7 @@ topklocksbywaitduration: guard-state r=req6 ---- -new: state=waitForDistinguished txn=txn2 key="b" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="b" held=false guard-strength=Intent # 250ms passes between req6 and req7 time-tick ms=250 @@ -571,7 +571,7 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn2 key="c" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="c" held=false guard-strength=Intent print ---- @@ -737,11 +737,11 @@ num=5 guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn3 key="f" held=true guard-access=read +new: state=waitForDistinguished txn=txn3 key="f" held=true guard-strength=None guard-state r=req6 ---- -old: state=waitForDistinguished txn=txn2 key="b" held=false guard-access=write +old: state=waitForDistinguished txn=txn2 key="b" held=false guard-strength=Intent print ---- @@ -948,11 +948,11 @@ num=4 guard-state r=req6 ---- -new: state=waitForDistinguished txn=txn2 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="b" held=true guard-strength=Intent guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn2 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="c" held=true guard-strength=Intent print ---- @@ -1121,7 +1121,7 @@ new: state=doneWaiting guard-state r=req6 ---- -old: state=waitForDistinguished txn=txn2 key="b" held=true guard-access=write +old: state=waitForDistinguished txn=txn2 key="b" held=true guard-strength=Intent print ---- @@ -1377,7 +1377,7 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn1 key="c" held=false guard-access=write +new: state=waitForDistinguished txn=txn1 key="c" held=false guard-strength=Intent scan r=req6 ---- @@ -1422,7 +1422,7 @@ start-waiting: true guard-state r=req8 ---- -new: state=waitForDistinguished txn=txn1 key="e" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="e" held=true guard-strength=Intent dequeue r=req8 ---- @@ -1655,7 +1655,7 @@ start-waiting: true guard-state r=req10 ---- -new: state=waitForDistinguished txn=txn1 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="c" held=true guard-strength=Intent new-request r=req11 txn=txn3 ts=6 spans=w@c ---- @@ -1666,7 +1666,7 @@ start-waiting: true guard-state r=req11 ---- -new: state=waitFor txn=txn1 key="c" held=true guard-access=write +new: state=waitFor txn=txn1 key="c" held=true guard-strength=Intent new-request r=req12 txn=txn2 ts=8,12 spans=w@c ---- @@ -1677,7 +1677,7 @@ start-waiting: true guard-state r=req12 ---- -new: state=waitFor txn=txn1 key="c" held=true guard-access=write +new: state=waitFor txn=txn1 key="c" held=true guard-strength=Intent print ---- @@ -1796,7 +1796,7 @@ new: state=doneWaiting guard-state r=req11 ---- -new: state=waitForDistinguished txn=txn2 key="c" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="c" held=false guard-strength=Intent guard-state r=req12 ---- @@ -1916,7 +1916,7 @@ num=1 guard-state r=req11 ---- -new: state=waitForDistinguished txn=txn2 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="c" held=true guard-strength=Intent # Since req10 that is also txn2 has acquired the lock, req12 does not need to wait here anymore. guard-state r=req12 @@ -2051,7 +2051,7 @@ num=1 guard-state r=req11 ---- -old: state=waitForDistinguished txn=txn2 key="c" held=true guard-access=write +old: state=waitForDistinguished txn=txn2 key="c" held=true guard-strength=Intent release txn=txn2 span=b,d ---- @@ -2475,7 +2475,7 @@ num=2 guard-state r=req18 ---- -new: state=waitFor txn=txn1 key="d" held=true guard-access=write +new: state=waitFor txn=txn1 key="d" held=true guard-strength=Intent print ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/clear b/pkg/kv/kvserver/concurrency/testdata/lock_table/clear index 429b5fe37407..d9f81bc4e5af 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/clear +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/clear @@ -81,7 +81,7 @@ start-waiting: true guard-state r=req3 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=None # Similarly, a non-transactional write at a arrives and blocks. @@ -94,7 +94,7 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitFor txn=txn1 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-strength=Intent # txn3 tries to write to b which also has a lock held, so txn3 has to wait. @@ -107,7 +107,7 @@ start-waiting: true guard-state r=req5 ---- -new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="b" held=true guard-strength=Intent print ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/clear_finalized_txn_locks b/pkg/kv/kvserver/concurrency/testdata/lock_table/clear_finalized_txn_locks index 8adc8b4df928..85591082b35f 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/clear_finalized_txn_locks +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/clear_finalized_txn_locks @@ -171,7 +171,7 @@ start-waiting: true guard-state r=req1 ---- -new: state=waitForDistinguished txn=txn4 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn4 key="c" held=true guard-strength=Intent print ---- @@ -417,11 +417,11 @@ start-waiting: true guard-state r=req6 ---- -new: state=waitFor txn=txn2 key="a" held=true guard-access=write +new: state=waitFor txn=txn2 key="a" held=true guard-strength=Intent guard-state r=req5 ---- -new: state=waitForDistinguished txn=txn2 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=true guard-strength=Intent print ---- @@ -452,7 +452,7 @@ num=2 guard-state r=req6 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=false guard-access=write +new: state=waitForDistinguished txn=txn1 key="a" held=false guard-strength=Intent guard-state r=req5 ---- @@ -527,7 +527,7 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn2 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=true guard-strength=Intent print ---- @@ -641,7 +641,7 @@ start-waiting: true guard-state r=req9 ---- -new: state=waitForDistinguished txn=txn4 key="c" held=true guard-access=read +new: state=waitForDistinguished txn=txn4 key="c" held=true guard-strength=None print ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/disable b/pkg/kv/kvserver/concurrency/testdata/lock_table/disable index c845ca8f79b8..c45bcb821232 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/disable +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/disable @@ -83,7 +83,7 @@ start-waiting: true guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn2 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=true guard-strength=Intent release txn=txn2 span=a ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/discovered_locks_consults_txn_cache b/pkg/kv/kvserver/concurrency/testdata/lock_table/discovered_locks_consults_txn_cache index 82e52e19c0c5..87e3239c7146 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/discovered_locks_consults_txn_cache +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/discovered_locks_consults_txn_cache @@ -99,7 +99,7 @@ start-waiting: true guard-state r=req1 ---- -new: state=waitForDistinguished txn=txn4 key="d" held=true guard-access=write +new: state=waitForDistinguished txn=txn4 key="d" held=true guard-strength=Intent dequeue r=req1 ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/dup_access b/pkg/kv/kvserver/concurrency/testdata/lock_table/dup_access index fcc5dbc8d359..a58404d43ca6 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/dup_access +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/dup_access @@ -45,7 +45,7 @@ start-waiting: true guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=Intent print ---- @@ -125,7 +125,7 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=Intent new-request r=req5 txn=txn3 ts=10 spans=w@b+w@c+r@b ---- @@ -136,7 +136,7 @@ start-waiting: true guard-state r=req5 ---- -new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="b" held=true guard-strength=Intent print ---- @@ -171,7 +171,7 @@ num=3 guard-state r=req5 ---- -new: state=waitForDistinguished txn=txn1 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="c" held=true guard-strength=Intent print ---- @@ -331,7 +331,7 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=Intent new-request r=req8 txn=none ts=10 spans=w@b+w@c+r@b ---- @@ -342,7 +342,7 @@ start-waiting: true guard-state r=req8 ---- -new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write +new: state=waitForDistinguished 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 @@ -356,7 +356,7 @@ start-waiting: true guard-state r=req9 ---- -new: state=waitFor txn=txn1 key="b" held=true guard-access=write +new: state=waitFor txn=txn1 key="b" held=true guard-strength=Intent print ---- @@ -392,7 +392,7 @@ num=3 guard-state r=req8 ---- -new: state=waitForDistinguished txn=txn1 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="c" held=true guard-strength=Intent print ---- @@ -472,7 +472,7 @@ num=2 guard-state r=req8 ---- -new: state=waitForDistinguished txn=txn2 key="b" held=true guard-access=read +new: state=waitForDistinguished txn=txn2 key="b" held=true guard-strength=None print ---- @@ -548,7 +548,7 @@ start-waiting: true guard-state r=req11 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=Intent new-request r=req12 txn=txn3 ts=10 spans=w@b+r@b ---- @@ -559,7 +559,7 @@ start-waiting: true guard-state r=req12 ---- -new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="b" held=true guard-strength=Intent print ---- @@ -639,7 +639,7 @@ start-waiting: true guard-state r=req12 ---- -new: state=waitForDistinguished txn=txn2 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="b" held=true guard-strength=Intent dequeue r=req11 ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_changes b/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_changes index 5b091edbd325..dd66c6afdda2 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_changes +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_changes @@ -124,7 +124,7 @@ start-waiting: true guard-state r=req5 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=None print ---- @@ -152,7 +152,7 @@ num=1 guard-state r=req5 ---- -old: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read +old: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=None acquire r=req6 k=a durability=u ---- @@ -180,7 +180,7 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=None add-discovered r=req7 k=a txn=txn1 ---- @@ -193,4 +193,4 @@ num=1 guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=None diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_dropped b/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_dropped index c99f2ced3d1e..11d2260c64ba 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_dropped +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/lock_dropped @@ -113,11 +113,11 @@ num=1 guard-state r=reqContendReader ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=None guard-state r=reqContendWriter ---- -new: state=waitFor txn=txn1 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-strength=Intent clear ---- @@ -164,7 +164,7 @@ start-waiting: true guard-state r=req3 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=None acquire r=req2 k=b durability=r ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/non_active_waiter b/pkg/kv/kvserver/concurrency/testdata/lock_table/non_active_waiter index e360f767962a..7516e7c9df9c 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/non_active_waiter +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/non_active_waiter @@ -95,7 +95,7 @@ start-waiting: true guard-state r=req1 ---- -new: state=waitForDistinguished txn=txn2 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=true guard-strength=Intent print ---- @@ -131,7 +131,7 @@ num=3 guard-state r=req1 ---- -new: state=waitFor txn=txn2 key="c" held=true guard-access=write +new: state=waitFor txn=txn2 key="c" held=true guard-strength=Intent print ---- @@ -163,7 +163,7 @@ num=3 guard-state r=req1 ---- -new: state=waitForDistinguished txn=txn2 key="b" held=true guard-access=read +new: state=waitForDistinguished txn=txn2 key="b" held=true guard-strength=None guard-state r=req2 ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/non_txn_write b/pkg/kv/kvserver/concurrency/testdata/lock_table/non_txn_write index fa7fe0620cd9..fba20bdb71d5 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/non_txn_write +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/non_txn_write @@ -131,7 +131,7 @@ new: state=doneWaiting guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn2 key="a" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=false guard-strength=Intent guard-state r=req5 ---- @@ -176,7 +176,7 @@ num=3 guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn3 key="b" held=false guard-access=write +new: state=waitForDistinguished txn=txn3 key="b" held=false guard-strength=Intent guard-state r=req6 ---- @@ -249,11 +249,11 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitForDistinguished txn=txn2 key="c" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="c" held=true guard-strength=Intent guard-state r=req5 ---- -new: state=waitFor txn=txn2 key="c" held=true guard-access=write +new: state=waitFor txn=txn2 key="c" held=true guard-strength=Intent # Release the lock. The non-transactional request does not acquire the reservation. diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/queue_length_exceeded b/pkg/kv/kvserver/concurrency/testdata/lock_table/queue_length_exceeded index 789a6cdcadcd..7e5b1c7bf834 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/queue_length_exceeded +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/queue_length_exceeded @@ -64,7 +64,7 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitFor txn=txn1 key="a" held=true guard-access=read +new: state=waitFor txn=txn1 key="a" held=true guard-strength=None dequeue r=req4 ---- @@ -92,7 +92,7 @@ start-waiting: true guard-state r=req5 ---- -new: state=waitFor txn=txn1 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-strength=Intent dequeue r=req5 ---- @@ -120,7 +120,7 @@ start-waiting: true guard-state r=req6 ---- -new: state=waitQueueMaxLengthExceeded txn=txn1 key="a" held=true guard-access=write +new: state=waitQueueMaxLengthExceeded txn=txn1 key="a" held=true guard-strength=Intent dequeue r=req6 ---- @@ -145,7 +145,7 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitFor txn=txn1 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-strength=Intent dequeue r=req7 ---- @@ -166,7 +166,7 @@ start-waiting: true guard-state r=req8 ---- -new: state=waitQueueMaxLengthExceeded txn=txn1 key="a" held=true guard-access=write +new: state=waitQueueMaxLengthExceeded txn=txn1 key="a" held=true guard-strength=Intent dequeue r=req8 ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/size_limit_exceeded b/pkg/kv/kvserver/concurrency/testdata/lock_table/size_limit_exceeded index 14fdacb87dcf..cc32b641ab9f 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/size_limit_exceeded +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/size_limit_exceeded @@ -135,7 +135,7 @@ num=3 guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn1 key="b" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="b" held=true guard-strength=Intent guard-state r=req3 ---- @@ -248,7 +248,7 @@ new: state=doneWaiting guard-state r=req6 ---- -new: state=waitElsewhere txn=txn1 key="c" held=true guard-access=write +new: state=waitElsewhere txn=txn1 key="c" held=true guard-strength=Intent scan r=req7 ---- @@ -256,4 +256,4 @@ start-waiting: true guard-state r=req7 ---- -new: state=waitForDistinguished txn=txn1 key="d" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="d" held=true guard-strength=Intent diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/update b/pkg/kv/kvserver/concurrency/testdata/lock_table/update index bcca16c67f71..0d58a23a0b6b 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/update +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/update @@ -63,7 +63,7 @@ start-waiting: true guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=read +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=None scan r=req3 ---- @@ -71,7 +71,7 @@ start-waiting: true guard-state r=req3 ---- -new: state=waitFor txn=txn1 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-strength=Intent scan r=req4 ---- @@ -79,7 +79,7 @@ start-waiting: true guard-state r=req4 ---- -new: state=waitFor txn=txn1 key="a" held=true guard-access=read +new: state=waitFor txn=txn1 key="a" held=true guard-strength=None scan r=req5 ---- @@ -87,7 +87,7 @@ start-waiting: true guard-state r=req5 ---- -new: state=waitFor txn=txn1 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-strength=Intent print ---- @@ -354,7 +354,7 @@ start-waiting: false guard-state r=req5 ---- -new: state=waitForDistinguished txn=txn3 key="a" held=false guard-access=write +new: state=waitForDistinguished txn=txn3 key="a" held=false guard-strength=Intent dequeue r=req3 ---- diff --git a/pkg/kv/kvserver/concurrency/testdata/lock_table/wait_self b/pkg/kv/kvserver/concurrency/testdata/lock_table/wait_self index 6238a3c437a6..a47d577481a8 100644 --- a/pkg/kv/kvserver/concurrency/testdata/lock_table/wait_self +++ b/pkg/kv/kvserver/concurrency/testdata/lock_table/wait_self @@ -59,15 +59,15 @@ start-waiting: true guard-state r=req2 ---- -new: state=waitForDistinguished txn=txn1 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn1 key="a" held=true guard-strength=Intent guard-state r=req3 ---- -new: state=waitFor txn=txn1 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-strength=Intent guard-state r=req4 ---- -new: state=waitFor txn=txn1 key="a" held=true guard-access=write +new: state=waitFor txn=txn1 key="a" held=true guard-strength=Intent print ---- @@ -96,7 +96,7 @@ new: state=doneWaiting guard-state r=req3 ---- -new: state=waitForDistinguished txn=txn2 key="a" held=false guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=false guard-strength=Intent guard-state r=req4 ---- @@ -137,7 +137,7 @@ num=1 guard-state r=req3 ---- -new: state=waitForDistinguished txn=txn2 key="a" held=true guard-access=write +new: state=waitForDistinguished txn=txn2 key="a" held=true guard-strength=Intent guard-state r=req4 ----