Skip to content

Commit

Permalink
allocator: vlog descriptor and config in planning
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kvoli committed May 11, 2023
1 parent f04439c commit db9239c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/kv/kvserver/allocator/plan/replicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit db9239c

Please sign in to comment.