enhance: Add channel name to shard leader log in meta cache (#37856)

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
wei liu 2024-11-21 19:24:31 +08:00 committed by GitHub
parent 97a44b62fd
commit 965bda6e60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -981,9 +981,9 @@ func (m *MetaCache) GetShards(ctx context.Context, withCache bool, database, col
ret := iterator.Shuffle()
m.leaderMut.Unlock()
nodeInfos := make([]string, 0)
for _, shardLeader := range newShardLeaders.shardLeaders {
for ch, shardLeader := range newShardLeaders.shardLeaders {
for _, nodeInfo := range shardLeader {
nodeInfos = append(nodeInfos, fmt.Sprintf("nodeID: %d, nodeAddr: %s", nodeInfo.nodeID, nodeInfo.address))
nodeInfos = append(nodeInfos, fmt.Sprintf("channel %s, nodeID: %d, nodeAddr: %s", ch, nodeInfo.nodeID, nodeInfo.address))
}
}
log.Debug("fill new collection shard leader", zap.Strings("nodeInfos", nodeInfos))

View File

@ -73,7 +73,6 @@ func (b *ScoreBasedBalancer) assignSegment(br *balanceReport, collectionID int64
if len(nodeItemsMap) == 0 {
return nil
}
log.Info("node workload status", zap.Int64("collectionID", collectionID), zap.Stringers("nodes", lo.Values(nodeItemsMap)))
queue := newPriorityQueue()
for _, item := range nodeItemsMap {
@ -351,6 +350,11 @@ func (b *ScoreBasedBalancer) genSegmentPlan(br *balanceReport, replica *meta.Rep
return nil
}
log.Info("node workload status",
zap.Int64("collectionID", replica.GetCollectionID()),
zap.Int64("replicaID", replica.GetID()),
zap.Stringers("nodes", lo.Values(nodeItemsMap)))
// list all segment which could be balanced, and calculate node's score
for _, node := range onlineNodes {
dist := b.dist.SegmentDistManager.GetByFilter(meta.WithCollectionID(replica.GetCollectionID()), meta.WithNodeID(node))