mirror of https://github.com/milvus-io/milvus.git
issue: #32811 pr: #32812 This PR enable stopping balance after balance has been suspended, in case of global balance has been suspend, then query node get a sigterm, if stopping balance won't be triggered, the query node exit progress will stuck Signed-off-by: Wei Liu <wei.liu@zilliz.com>pull/33127/head
parent
0abc0d05a4
commit
d842efbff3
|
@ -113,10 +113,12 @@ func (b *BalanceChecker) replicasToBalance() []int64 {
|
||||||
return stoppingReplicas
|
return stoppingReplicas
|
||||||
}
|
}
|
||||||
|
|
||||||
// no stopping balance and auto balance is disabled, return empty collections for balance
|
// 1. if auto balance is disabled, return empty collections for balance
|
||||||
if !Params.QueryCoordCfg.AutoBalance.GetAsBool() {
|
// 2. when balancer isn't active, skip auto balance
|
||||||
|
if !Params.QueryCoordCfg.AutoBalance.GetAsBool() || !b.IsActive() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// scheduler is handling segment task, skip
|
// scheduler is handling segment task, skip
|
||||||
if b.scheduler.GetSegmentTaskNum() != 0 {
|
if b.scheduler.GetSegmentTaskNum() != 0 {
|
||||||
return nil
|
return nil
|
||||||
|
@ -165,9 +167,6 @@ func (b *BalanceChecker) balanceReplicas(replicaIDs []int64) ([]balance.SegmentA
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BalanceChecker) Check(ctx context.Context) []task.Task {
|
func (b *BalanceChecker) Check(ctx context.Context) []task.Task {
|
||||||
if !b.IsActive() {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
ret := make([]task.Task, 0)
|
ret := make([]task.Task, 0)
|
||||||
|
|
||||||
replicasToBalance := b.replicasToBalance()
|
replicasToBalance := b.replicasToBalance()
|
||||||
|
|
Loading…
Reference in New Issue