Skip to content

Commit

Permalink
concurrency: use of lock.Modes to determine confilcts in tryActiveWait
Browse files Browse the repository at this point in the history
This patch refactors tryActiveWait to make use of lock.Modes to
determine conflicts. In doing so, it splits out the logic into 3
different methods:

1. To determine a conflict with a lock holder.
2. To determine a conflict with a reservation.
3. To modify datastructures in preparation for active wait.

In doing so, we no longer make the assumption that there will only
ever be a single reservation or lock holder on a key. In the future,
we'll be able to further extend tryActiveWait to account for multiple
locks/reservations on a key.

Informs #102210

Release note: None
  • Loading branch information
arulajmani committed May 9, 2023
1 parent 42ba435 commit 4d8b392
Show file tree
Hide file tree
Showing 2 changed files with 371 additions and 245 deletions.
1 change: 1 addition & 0 deletions pkg/kv/kvserver/concurrency/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ go_library(
deps = [
"//pkg/kv",
"//pkg/kv/kvpb",
"//pkg/kv/kvserver/concurrency/isolation",
"//pkg/kv/kvserver/concurrency/lock",
"//pkg/kv/kvserver/concurrency/poison",
"//pkg/kv/kvserver/intentresolver",
Expand Down
Loading

0 comments on commit 4d8b392

Please sign in to comment.