Skip to content

Commit

Permalink
concurrency: do not partition locks in the lock table by span scope
Browse files Browse the repository at this point in the history
This patch is entirely a refactor and does not change any
functionality. This is done in preparation for introducing
`LockSpanSets` to track lock spans, which do not make a distinction
between global and local keys (unlike `SpanSets`, which do).

The main changes here are in `lockTableImpl`, which actually stores
locks, and `lockTableGuardImpl` which snapshots the lock table. We
no longer make a distinction between locks on Local and Global keys
when storing them.  The majority of this diff is composed of test file
churn caused because of the printing changes to the lock table.

Informs #102008

Release note: None
  • Loading branch information
arulajmani committed Apr 28, 2023
1 parent 0f4d6c5 commit 1cf1508
Show file tree
Hide file tree
Showing 41 changed files with 557 additions and 1,078 deletions.
5 changes: 0 additions & 5 deletions pkg/kv/kvserver/batcheval/cmd_query_locks.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@ func QueryLocks(
reply := resp.(*kvpb.QueryLocksResponse)

concurrencyManager := cArgs.EvalCtx.GetConcurrencyManager()
keyScope := spanset.SpanGlobal
if keys.IsLocal(args.Key) {
keyScope = spanset.SpanLocal
}
opts := concurrency.QueryLockTableOptions{
KeyScope: keyScope,
MaxLocks: h.MaxSpanRequestKeys,
TargetBytes: h.TargetBytes,
IncludeUncontended: args.IncludeUncontended,
Expand Down
1 change: 0 additions & 1 deletion pkg/kv/kvserver/concurrency/concurrency_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ type Error = kvpb.Error

// QueryLockTableOptions bundles the options for the QueryLockTableState function.
type QueryLockTableOptions struct {
KeyScope spanset.SpanScope
MaxLocks int64
TargetBytes int64
IncludeUncontended bool
Expand Down
Loading

0 comments on commit 1cf1508

Please sign in to comment.