fix: collection level MMAP does not take effect for STRUCT (#44996)

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

Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
This commit is contained in:
Spade A 2025-10-23 19:52:05 +08:00 committed by GitHub
parent 7aa56e1fb6
commit 6494c75d31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -145,7 +145,6 @@ func packLoadSegmentRequest(
loadScope = querypb.LoadScope_Delta
}
// todo(SpadeA): consider struct fields
schema = applyCollectionMmapSetting(schema, collectionProperties)
return &querypb.LoadSegmentsRequest{
@ -285,5 +284,16 @@ func applyCollectionMmapSetting(schema *schemapb.CollectionSchema,
})
}
}
for _, structField := range schema.GetStructArrayFields() {
for _, field := range structField.GetFields() {
if exist &&
!common.FieldHasMmapKey(schema, field.GetFieldID()) {
field.TypeParams = append(field.TypeParams, &commonpb.KeyValuePair{
Key: common.MmapEnabledKey,
Value: strconv.FormatBool(collectionMmapEnabled),
})
}
}
}
return schema
}