Skip to content

Commit 44eeb48

Browse files
authored
Merge pull request #115025 from cockroachdb/blathers/backport-release-23.2-114773
release-23.2: storage: avoid expensive logging in MVCCAcquireLock
2 parents 5a99ae9 + 49d1821 commit 44eeb48

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/storage/mvcc.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5938,9 +5938,11 @@ func MVCCAcquireLock(
59385938
// number, our newer sequence number could then be rolled back and
59395939
// we would forget that the lock held at the older sequence number
59405940
// had been and still should be held.
5941-
log.VEventf(ctx, 3, "skipping lock acquisition for txn %s on key %s "+
5942-
"with strength %s; found existing lock with strength %s and sequence %d",
5943-
txn, key.String(), str.String(), iterStr.String(), foundLock.Txn.Sequence)
5941+
if log.ExpensiveLogEnabled(ctx, 3) {
5942+
log.VEventf(ctx, 3, "skipping lock acquisition for txn %s on key %s "+
5943+
"with strength %s; found existing lock with strength %s and sequence %d",
5944+
txn, key, str, iterStr, foundLock.Txn.Sequence)
5945+
}
59445946
return nil
59455947
}
59465948

0 commit comments

Comments
 (0)