Skip to content

Commit

Permalink
enhance: [Cherry-pick] Shuffle candidates before channel assignment (#…
Browse files Browse the repository at this point in the history
…30066) (#30089)

Cherry-pick from master
pr: #30066

Shuffle candidates to reduce scenario that some channel allocated into
same node

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
  • Loading branch information
congqixia committed Jan 19, 2024
1 parent 0700434 commit 079ddbf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/querycoordv2/balance/rowcount_based_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func (b *RowCountBasedBalancer) AssignSegment(collectionID int64, segments []*me
// try to make every query node has channel count
func (b *RowCountBasedBalancer) AssignChannel(channels []*meta.DmChannel, nodes []int64) []ChannelAssignPlan {
nodeItems := b.convertToNodeItemsByChannel(nodes)
nodeItems = lo.Shuffle(nodeItems)
if len(nodeItems) == 0 {
return nil
}
Expand Down

0 comments on commit 079ddbf

Please sign in to comment.