enhance: Shuffle candidates before channel assignment (#30066)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/30083/head
congqixia 2024-01-17 19:34:53 +08:00 committed by GitHub
parent 04e21564b6
commit 4c93912135
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -77,6 +77,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
}