diff --git a/internal/indexcoord/index_coord.go b/internal/indexcoord/index_coord.go index a8ffe472c1..968f3d6157 100644 --- a/internal/indexcoord/index_coord.go +++ b/internal/indexcoord/index_coord.go @@ -55,6 +55,10 @@ import ( // make sure IndexCoord implements types.IndexCoord var _ types.IndexCoord = (*IndexCoord)(nil) +const ( + indexSizeFactor = 6 +) + // IndexCoord is a component responsible for scheduling index construction tasks and maintaining index status. // IndexCoord accepts requests from rootcoord to build indexes, delete indexes, and query index information. // IndexCoord is responsible for assigning IndexBuildID to the request to build the index, and forwarding the diff --git a/internal/indexcoord/node_manager.go b/internal/indexcoord/node_manager.go index fa1d510ffe..4dccc17f2f 100644 --- a/internal/indexcoord/node_manager.go +++ b/internal/indexcoord/node_manager.go @@ -109,18 +109,18 @@ func (nm *NodeManager) PeekClient(meta Meta) (UniqueID, types.IndexNode) { log.Error(err.Error()) return UniqueID(-1), nil } - indexSize, err := estimateIndexSize(dim, meta.indexMeta.Req.NumRows, meta.indexMeta.Req.FieldSchema.DataType) + dataSize, err := estimateIndexSize(dim, meta.indexMeta.Req.NumRows, meta.indexMeta.Req.FieldSchema.DataType) if err != nil { log.Warn(err.Error()) return UniqueID(-1), nil } - nodeID := nm.pq.Peek(indexSize, meta.indexMeta.Req.IndexParams, meta.indexMeta.Req.TypeParams) + nodeID := nm.pq.Peek(dataSize*indexSizeFactor, meta.indexMeta.Req.IndexParams, meta.indexMeta.Req.TypeParams) client, ok := nm.nodeClients[nodeID] if !ok { log.Error("IndexCoord NodeManager PeekClient", zap.Any("There is no IndexNode client corresponding to NodeID", nodeID)) return nodeID, nil } - log.Debug("IndexCoord NodeManager PeekClient ", zap.Int64("node", nodeID)) + log.Debug("IndexCoord NodeManager PeekClient ", zap.Int64("node", nodeID), zap.Uint64("data size", dataSize)) return nodeID, client }