From db9239cd1857e28eda73c5337575bbf16f4208e0 Mon Sep 17 00:00:00 2001 From: Austen McClernon Date: Wed, 10 May 2023 19:32:22 +0000 Subject: [PATCH] allocator: vlog descriptor and config in planning Previously, a range's span config was not logged during allocation activity; the descriptor occasionally was. This commit adds v=6 logging in `ShouldPlanChange` and `PlanOneChange` which includes the range descriptor and span config being applied. The intention is that this additional logging will make debugging test failures quicker. Epic: none Release note: None --- pkg/kv/kvserver/allocator/plan/replicate.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/kv/kvserver/allocator/plan/replicate.go b/pkg/kv/kvserver/allocator/plan/replicate.go index 2ce7e90e0fa6..99a08ab105fe 100644 --- a/pkg/kv/kvserver/allocator/plan/replicate.go +++ b/pkg/kv/kvserver/allocator/plan/replicate.go @@ -144,6 +144,10 @@ func (rp ReplicaPlanner) ShouldPlanChange( canTransferLeaseFrom CanTransferLeaseFrom, ) (shouldPlanChange bool, priority float64) { desc, conf := repl.DescAndSpanConfig() + + log.KvDistribution.VEventf(ctx, 6, + "computing range action desc=%s config=%s", + desc, conf.String()) action, priority := rp.allocator.ComputeAction(ctx, rp.storePool, conf, desc) if action == allocatorimpl.AllocatorNoop { @@ -249,6 +253,9 @@ func (rp ReplicaPlanner) PlanOneChange( // successfully execute a decision that was based on the state of a stale // range descriptor. desc, conf := repl.DescAndSpanConfig() + log.KvDistribution.VEventf(ctx, 6, + "planning range change desc=%s config=%s", + desc, conf.String()) voterReplicas, nonVoterReplicas, liveVoterReplicas, deadVoterReplicas,