From df7aafa3ec5cab41328f76397aa1d812c74f7620 Mon Sep 17 00:00:00 2001 From: Bingyi Sun Date: Wed, 6 Mar 2024 16:03:00 +0800 Subject: [PATCH] fix: filter mmap key when checking index params (#31030) issue: https://github.com/milvus-io/milvus/issues/31031 Signed-off-by: sunby --- internal/datacoord/index_meta.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/internal/datacoord/index_meta.go b/internal/datacoord/index_meta.go index f2739ff8f348e..209811ded8e76 100644 --- a/internal/datacoord/index_meta.go +++ b/internal/datacoord/index_meta.go @@ -184,10 +184,19 @@ func checkParams(fieldIndex *model.Index, req *indexpb.CreateIndexRequest) bool if notEq { return false } - if len(fieldIndex.UserIndexParams) != len(req.GetUserIndexParams()) { + + userIndexParamsWithoutMmapKey := make([]*commonpb.KeyValuePair, 0) + for _, param := range fieldIndex.UserIndexParams { + if param.Key == common.MmapEnabledKey { + continue + } + userIndexParamsWithoutMmapKey = append(userIndexParamsWithoutMmapKey, param) + } + + if len(userIndexParamsWithoutMmapKey) != len(req.GetUserIndexParams()) { return false } - for _, param1 := range fieldIndex.UserIndexParams { + for _, param1 := range userIndexParamsWithoutMmapKey { exist := false for _, param2 := range req.GetUserIndexParams() { if param2.Key == param1.Key && param2.Value == param1.Value {