Skip to content

Commit c2c3fbd

Browse files
committed
allocator: correct logging for priority assertion
This commit fixes an incorrect log statement in computeAction for priority assertions. The log was mistakenly emitted even when the priority was not -1. Related: #152512 Release note: none
1 parent 8ab959a commit c2c3fbd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/kv/kvserver/allocator/allocatorimpl/allocator.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -965,10 +965,12 @@ func (a *Allocator) ComputeAction(
965965
// the caller expects the processing logic to be invoked even if there's a
966966
// priority inversion. If the priority is not -1, the range might be re-queued
967967
// to be processed with the correct priority.
968-
if priority == -1 && buildutil.CrdbTestBuild {
969-
log.Dev.Fatalf(ctx, "allocator returned -1 priority for range %s: %v", desc, action)
970-
} else {
971-
log.Dev.Warningf(ctx, "allocator returned -1 priority for range %s: %v", desc, action)
968+
if priority == -1 {
969+
if buildutil.CrdbTestBuild {
970+
log.Dev.Fatalf(ctx, "allocator returned -1 priority for range %s: %v", desc, action)
971+
} else {
972+
log.Dev.Warningf(ctx, "allocator returned -1 priority for range %s: %v", desc, action)
973+
}
972974
}
973975
return action, priority
974976
}

0 commit comments

Comments
 (0)