fix: filter mmap key when checking index params (#31030)

issue: https://github.com/milvus-io/milvus/issues/31031

Signed-off-by: sunby <sunbingyi1992@gmail.com>
This commit is contained in:
Bingyi Sun 2024-03-06 16:03:00 +08:00 committed by GitHub
parent a88c896733
commit df7aafa3ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {