enhance: enable stopping balance after balance has been suspended (#32812)

issue: #32811

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
wei liu 2024-05-08 10:15:29 +08:00 committed by GitHub
parent ba02d54a30
commit fad8f0afa5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -116,10 +116,12 @@ func (b *BalanceChecker) replicasToBalance() []int64 {
}
}
// no stopping balance and auto balance is disabled, return empty collections for balance
if !Params.QueryCoordCfg.AutoBalance.GetAsBool() {
// 1. no stopping balance and auto balance is disabled, return empty collections for balance
// 2. when balancer isn't active, skip auto balance
if !Params.QueryCoordCfg.AutoBalance.GetAsBool() || !b.IsActive() {
return nil
}
// scheduler is handling segment task, skip
if b.scheduler.GetSegmentTaskNum() != 0 {
return nil
@ -168,9 +170,6 @@ func (b *BalanceChecker) balanceReplicas(replicaIDs []int64) ([]balance.SegmentA
}
func (b *BalanceChecker) Check(ctx context.Context) []task.Task {
if !b.IsActive() {
return nil
}
ret := make([]task.Task, 0)
replicasToBalance := b.replicasToBalance()