Skip to content

Commit

Permalink
kv: remove assertions around non-txn'al locking reqs
Browse files Browse the repository at this point in the history
Closes #107860.
Closes #109222.
Closes #109581.
Closes #109582.

We might want to re-introduce these assertions in the future and reject
these requests higher up the stack. For now, just remove them to deflake
tests.

Release note: None
  • Loading branch information
nvanbenschoten committed Aug 28, 2023
1 parent 5f6fbc0 commit e980fd1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/kv/kvserver/concurrency/lock_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,19 +801,17 @@ func (g *lockTableGuardImpl) curLockMode() lock.Mode {

// makeLockMode constructs and returns a lock mode.
func makeLockMode(str lock.Strength, txn *roachpb.Transaction, ts hlc.Timestamp) lock.Mode {
iso := isolation.Serializable
if txn != nil {
iso = txn.IsoLevel
}
switch str {
case lock.None:
iso := isolation.Serializable
if txn != nil {
iso = txn.IsoLevel
}
return lock.MakeModeNone(ts, iso)
case lock.Shared:
assert(txn != nil, "only transactional requests can acquire shared locks")
return lock.MakeModeShared()
case lock.Exclusive:
assert(txn != nil, "only transactional requests can acquire exclusive locks")
return lock.MakeModeExclusive(ts, txn.IsoLevel)
return lock.MakeModeExclusive(ts, iso)
case lock.Intent:
return lock.MakeModeIntent(ts)
default:
Expand Down

0 comments on commit e980fd1

Please sign in to comment.