Skip to content

Commit

Permalink
Merge #139706
Browse files Browse the repository at this point in the history
139706: kvserver: avoid an alloc in the write path r=tbg a=tbg

Randomly saw this in a profile over in #139557.

<img width="633" alt="image" src="https://github.com/user-attachments/assets/a1f7c2b8-3d73-4199-a641-8b520b0a202e" />

Epic: CRDB-42584
Release note: none


Co-authored-by: Tobias Grieger <[email protected]>
  • Loading branch information
craig[bot] and tbg committed Jan 24, 2025
2 parents a616c80 + 04d5821 commit 8ad1c13
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/kv/kvserver/replica_proposal_buf.go
Original file line number Diff line number Diff line change
Expand Up @@ -925,11 +925,13 @@ func maybeDeductFlowTokens(
// free up all tracked tokens as a result of this leadership change.
return
}
log.VInfof(ctx, 1, "bound index/log terms for proposal entry: %s",
raft.DescribeEntry(ents[i], func(bytes []byte) string {
return "<omitted>"
}),
)
if log.ExpensiveLogEnabled(ctx, 1) {
log.VInfof(ctx, 1, "bound index/log terms for proposal entry: %s",
raft.DescribeEntry(ents[i], func(bytes []byte) string {
return "<omitted>"
}),
)
}
h.DeductTokensFor(
admitHandle.pCtx,
admissionpb.WorkPriority(admitHandle.handle.AdmissionPriority),
Expand Down

0 comments on commit 8ad1c13

Please sign in to comment.