mirror of https://github.com/milvus-io/milvus.git
The memory of indexnode must be 6 times the segment size (#13213)
Signed-off-by: cai.zhang <cai.zhang@zilliz.com>pull/13252/head
parent
ed7ab5ade5
commit
af46998a2a
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue