Skip to content

Commit

Permalink
schedule: fix the filter metrics flush (#8097) (#8463)
Browse files Browse the repository at this point in the history
close #8098

schedule: fix the filter metrics flush

Signed-off-by: nolouch <nolouch@gmail.com>

Co-authored-by: nolouch <nolouch@gmail.com>
  • Loading branch information
ti-chi-bot and nolouch authored Jul 31, 2024
1 parent 632ee6e commit 66fc7c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/schedule/schedulers/balance_leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ func (l *balanceLeaderScheduler) Schedule(cluster sche.SchedulerCluster, dryRun
if dryRun {
collector = plan.NewCollector(basePlan)
}
defer l.filterCounter.Flush()
batch := l.conf.getBatch()
balanceLeaderScheduleCounter.Inc()

Expand Down Expand Up @@ -402,7 +403,6 @@ func (l *balanceLeaderScheduler) Schedule(cluster sche.SchedulerCluster, dryRun
}
}
}
l.filterCounter.Flush()
l.retryQuota.GC(append(sourceCandidate.stores, targetCandidate.stores...))
return result, collector.GetPlans()
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/schedule/schedulers/balance_region.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func (s *balanceRegionScheduler) IsScheduleAllowed(cluster sche.SchedulerCluster

func (s *balanceRegionScheduler) Schedule(cluster sche.SchedulerCluster, dryRun bool) ([]*operator.Operator, []plan.Plan) {
basePlan := plan.NewBalanceSchedulerPlan()
defer s.filterCounter.Flush()
var collector *plan.Collector
if dryRun {
collector = plan.NewCollector(basePlan)
Expand Down Expand Up @@ -224,7 +225,6 @@ func (s *balanceRegionScheduler) Schedule(cluster sche.SchedulerCluster, dryRun
}
s.retryQuota.Attenuate(solver.Source)
}
s.filterCounter.Flush()
s.retryQuota.GC(stores)
return nil, collector.GetPlans()
}
Expand Down

0 comments on commit 66fc7c4

Please sign in to comment.