github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/kv/kvserver/concurrency/testdata/concurrency_manager/clear_abandoned_intents (about)

     1  # -------------------------------------------------------------
     2  # A scan finds 10 abandoned intents from same txn
     3  # -------------------------------------------------------------
     4  
     5  new-txn name=txn1 ts=10,1 epoch=0
     6  ----
     7  
     8  new-txn name=txn2 ts=10,1 epoch=0
     9  ----
    10  
    11  new-request name=req1 txn=txn1 ts=10,1
    12    scan key=a endkey=z
    13  ----
    14  
    15  sequence req=req1
    16  ----
    17  [1] sequence req1: sequencing request
    18  [1] sequence req1: acquiring latches
    19  [1] sequence req1: scanning lock table for conflicting locks
    20  [1] sequence req1: sequencing complete, returned guard
    21  
    22  handle-write-intent-error req=req1
    23    intent txn=txn2 key=a
    24    intent txn=txn2 key=b
    25    intent txn=txn2 key=c
    26    intent txn=txn2 key=d
    27    intent txn=txn2 key=e
    28    intent txn=txn2 key=f
    29    intent txn=txn2 key=g
    30    intent txn=txn2 key=h
    31    intent txn=txn2 key=i
    32    intent txn=txn2 key=j
    33  ----
    34  [2] handle write intent error req1: handled conflicting intents on "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", released latches
    35  
    36  debug-lock-table
    37  ----
    38  global: num=10
    39   lock: "a"
    40    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    41   lock: "b"
    42    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    43   lock: "c"
    44    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    45   lock: "d"
    46    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    47   lock: "e"
    48    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    49   lock: "f"
    50    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    51   lock: "g"
    52    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    53   lock: "h"
    54    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    55   lock: "i"
    56    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    57   lock: "j"
    58    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    59  local: num=0
    60  
    61  sequence req=req1
    62  ----
    63  [3] sequence req1: re-sequencing request
    64  [3] sequence req1: acquiring latches
    65  [3] sequence req1: scanning lock table for conflicting locks
    66  [3] sequence req1: waiting in lock wait-queues
    67  [3] sequence req1: pushing timestamp of txn 00000002 above 0.000000010,1
    68  [3] sequence req1: blocked on select in concurrency_test.(*cluster).PushTransaction
    69  
    70  debug-lock-table
    71  ----
    72  global: num=10
    73   lock: "a"
    74    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    75     waiting readers:
    76      req: 1, txn: 00000001-0000-0000-0000-000000000000
    77     distinguished req: 1
    78   lock: "b"
    79    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    80   lock: "c"
    81    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    82   lock: "d"
    83    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    84   lock: "e"
    85    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    86   lock: "f"
    87    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    88   lock: "g"
    89    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    90   lock: "h"
    91    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    92   lock: "i"
    93    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    94   lock: "j"
    95    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
    96  local: num=0
    97  
    98  # txn1 is the distinguished waiter on key "a". It will push txn2, notice that it
    99  # is aborted, and then resolve key "a". Once txn2 is in the finalizedTxnCache,
   100  # txn1 will create a batch to resolve all other keys together.
   101  on-txn-updated txn=txn2 status=aborted
   102  ----
   103  [-] update txn: aborting txn2
   104  [3] sequence req1: resolving intent "a" for txn 00000002 with ABORTED status
   105  [3] sequence req1: resolving a batch of 9 intent(s)
   106  [3] sequence req1: resolving intent "b" for txn 00000002 with ABORTED status
   107  [3] sequence req1: resolving intent "c" for txn 00000002 with ABORTED status
   108  [3] sequence req1: resolving intent "d" for txn 00000002 with ABORTED status
   109  [3] sequence req1: resolving intent "e" for txn 00000002 with ABORTED status
   110  [3] sequence req1: resolving intent "f" for txn 00000002 with ABORTED status
   111  [3] sequence req1: resolving intent "g" for txn 00000002 with ABORTED status
   112  [3] sequence req1: resolving intent "h" for txn 00000002 with ABORTED status
   113  [3] sequence req1: resolving intent "i" for txn 00000002 with ABORTED status
   114  [3] sequence req1: resolving intent "j" for txn 00000002 with ABORTED status
   115  [3] sequence req1: acquiring latches
   116  [3] sequence req1: scanning lock table for conflicting locks
   117  [3] sequence req1: sequencing complete, returned guard
   118  
   119  debug-lock-table
   120  ----
   121  global: num=0
   122  local: num=0
   123  
   124  finish req=req1
   125  ----
   126  [-] finish req1: finishing request
   127  
   128  reset namespace
   129  ----
   130  
   131  # -------------------------------------------------------------
   132  # A series of 3 puts find 1 abandoned intent each from same txn
   133  # -------------------------------------------------------------
   134  
   135  new-txn name=txn1 ts=10,1 epoch=0
   136  ----
   137  
   138  new-txn name=txn2 ts=10,1 epoch=0
   139  ----
   140  
   141  new-request name=req1 txn=txn1 ts=10,1
   142    put key=a value=v1
   143    put key=b value=v2
   144    put key=c value=v3
   145  ----
   146  
   147  sequence req=req1
   148  ----
   149  [1] sequence req1: sequencing request
   150  [1] sequence req1: acquiring latches
   151  [1] sequence req1: scanning lock table for conflicting locks
   152  [1] sequence req1: sequencing complete, returned guard
   153  
   154  handle-write-intent-error req=req1
   155    intent txn=txn2 key=a
   156  ----
   157  [2] handle write intent error req1: handled conflicting intents on "a", released latches
   158  
   159  debug-lock-table
   160  ----
   161  global: num=1
   162   lock: "a"
   163    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
   164     queued writers:
   165      active: false req: 2, txn: 00000001-0000-0000-0000-000000000000
   166  local: num=0
   167  
   168  sequence req=req1
   169  ----
   170  [3] sequence req1: re-sequencing request
   171  [3] sequence req1: acquiring latches
   172  [3] sequence req1: scanning lock table for conflicting locks
   173  [3] sequence req1: waiting in lock wait-queues
   174  [3] sequence req1: pushing txn 00000002 to abort
   175  [3] sequence req1: blocked on select in concurrency_test.(*cluster).PushTransaction
   176  
   177  on-txn-updated txn=txn2 status=committed
   178  ----
   179  [-] update txn: committing txn2
   180  [3] sequence req1: resolving intent "a" for txn 00000002 with COMMITTED status
   181  [3] sequence req1: acquiring latches
   182  [3] sequence req1: scanning lock table for conflicting locks
   183  [3] sequence req1: sequencing complete, returned guard
   184  
   185  handle-write-intent-error req=req1
   186    intent txn=txn2 key=b
   187  ----
   188  [4] handle write intent error req1: handled conflicting intents on "b", released latches
   189  
   190  debug-lock-table
   191  ----
   192  global: num=2
   193   lock: "a"
   194    res: req: 2, txn: 00000001-0000-0000-0000-000000000000, ts: 0.000000010,1, seq: 0
   195   lock: "b"
   196    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
   197     queued writers:
   198      active: false req: 2, txn: 00000001-0000-0000-0000-000000000000
   199  local: num=0
   200  
   201  sequence req=req1
   202  ----
   203  [5] sequence req1: re-sequencing request
   204  [5] sequence req1: acquiring latches
   205  [5] sequence req1: scanning lock table for conflicting locks
   206  [5] sequence req1: waiting in lock wait-queues
   207  [5] sequence req1: resolving a batch of 1 intent(s)
   208  [5] sequence req1: resolving intent "b" for txn 00000002 with COMMITTED status
   209  [5] sequence req1: acquiring latches
   210  [5] sequence req1: scanning lock table for conflicting locks
   211  [5] sequence req1: sequencing complete, returned guard
   212  
   213  handle-write-intent-error req=req1
   214    intent txn=txn2 key=c
   215  ----
   216  [6] handle write intent error req1: handled conflicting intents on "c", released latches
   217  
   218  debug-lock-table
   219  ----
   220  global: num=3
   221   lock: "a"
   222    res: req: 2, txn: 00000001-0000-0000-0000-000000000000, ts: 0.000000010,1, seq: 0
   223   lock: "b"
   224    res: req: 2, txn: 00000001-0000-0000-0000-000000000000, ts: 0.000000010,1, seq: 0
   225   lock: "c"
   226    holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000010,1, info: repl epoch: 0, seqs: [0]
   227     queued writers:
   228      active: false req: 2, txn: 00000001-0000-0000-0000-000000000000
   229  local: num=0
   230  
   231  sequence req=req1
   232  ----
   233  [7] sequence req1: re-sequencing request
   234  [7] sequence req1: acquiring latches
   235  [7] sequence req1: scanning lock table for conflicting locks
   236  [7] sequence req1: waiting in lock wait-queues
   237  [7] sequence req1: resolving a batch of 1 intent(s)
   238  [7] sequence req1: resolving intent "c" for txn 00000002 with COMMITTED status
   239  [7] sequence req1: acquiring latches
   240  [7] sequence req1: scanning lock table for conflicting locks
   241  [7] sequence req1: sequencing complete, returned guard
   242  
   243  debug-lock-table
   244  ----
   245  global: num=3
   246   lock: "a"
   247    res: req: 2, txn: 00000001-0000-0000-0000-000000000000, ts: 0.000000010,1, seq: 0
   248   lock: "b"
   249    res: req: 2, txn: 00000001-0000-0000-0000-000000000000, ts: 0.000000010,1, seq: 0
   250   lock: "c"
   251    res: req: 2, txn: 00000001-0000-0000-0000-000000000000, ts: 0.000000010,1, seq: 0
   252  local: num=0
   253  
   254  finish req=req1
   255  ----
   256  [-] finish req1: finishing request
   257  
   258  reset namespace
   259  ----