From af46998a2a28b62dfe87d2a40059dd8899d112e5 Mon Sep 17 00:00:00 2001 From: "cai.zhang" Date: Mon, 13 Dec 2021 15:06:29 +0800 Subject: [PATCH] The memory of indexnode must be 6 times the segment size (#13213) Signed-off-by: cai.zhang --- internal/indexcoord/index_coord.go | 4 ++++ internal/indexcoord/node_manager.go | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) 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 }