Skip to content

Commit 82081eb

Browse files
authored
fix: [2.5] Fix deactivate balance checker also stops stopping balance (milvus-io#44835)
issue: milvus-io#43858 pr: milvus-io#44834 Fix the issue introduced in PR milvus-io#43992 where deactivating the balance checker incorrectly stops stopping balance operations. Changes: - Move IsActive() check after stopping balance logic - Only skip normal balance when checker is inactive - Allow stopping balance to proceed regardless of checker state This ensures stopping balance can execute even when the balance checker is deactivated. --------- Signed-off-by: Wei Liu <[email protected]>
1 parent 71fc23d commit 82081eb

File tree

2 files changed

+345
-80
lines changed

2 files changed

+345
-80
lines changed

internal/querycoordv2/checkers/balance_checker.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,6 @@ func (b *BalanceChecker) submitTasks(segmentTasks, channelTasks []task.Task) {
468468
// The method tracks execution time and logs warnings for slow operations
469469
// to help identify performance bottlenecks in large clusters.
470470
func (b *BalanceChecker) Check(ctx context.Context) []task.Task {
471-
// Skip balance operations if the checker is not active
472-
if !b.IsActive() {
473-
return nil
474-
}
475-
476471
// Performance monitoring: track execution time
477472
start := time.Now()
478473
defer func() {
@@ -503,6 +498,11 @@ func (b *BalanceChecker) Check(ctx context.Context) []task.Task {
503498
}
504499
}
505500

501+
// Only Skip normal balance operations if the checker is not active
502+
if !b.IsActive() {
503+
return nil
504+
}
505+
506506
// Phase 2: Process normal balance if no stopping balance was needed
507507
// This handles regular load balancing operations for cluster optimization
508508
if paramtable.Get().QueryCoordCfg.AutoBalance.GetAsBool() {

0 commit comments

Comments
 (0)