Skip to content

Commit 9eed24a

Browse files
committed
mmaprototype: improve logging in sort[...]AndPick
1 parent 2684610 commit 9eed24a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/kv/kvserver/allocator/mmaprototype/allocator_state.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,14 +585,15 @@ func sortTargetCandidateSetAndPick(
585585
(cand.nls == loadThreshold && ignoreLevel < ignoreHigherThanLoadThreshold)
586586
candDiscardedByOverloadDim := overloadedDim != NumLoadDimensions &&
587587
cand.dimSummary[overloadedDim] >= loadNoChange
588-
if candDiscardedByNLS || candDiscardedByOverloadDim ||
589-
cand.maxFractionPendingIncrease >= maxFractionPendingThreshold {
588+
candDiscardedByPendingThreshold := cand.maxFractionPendingIncrease >= maxFractionPendingThreshold
589+
if candDiscardedByNLS || candDiscardedByOverloadDim || candDiscardedByPendingThreshold {
590590
// Discard this candidate.
591591
if cand.maxFractionPendingIncrease > epsilon && discardedCandsHadNoPendingChanges {
592592
discardedCandsHadNoPendingChanges = false
593593
}
594594
log.KvDistribution.VEventf(ctx, 2,
595-
"candiate store %v was discarded: sls=%v", cand.StoreID, cand.storeLoadSummary)
595+
"candiate store %v was discarded due to (nls=%t overloadDim=%t pending_thresh=%t): sls=%v", cand.StoreID,
596+
candDiscardedByNLS, candDiscardedByOverloadDim, candDiscardedByPendingThreshold, cand.storeLoadSummary)
596597
continue
597598
}
598599
cands.candidates[j] = cand

0 commit comments

Comments
 (0)