fix: mmap properties failed to apply when creating collection(#40511) (#40512)

related: #40511

Signed-off-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: MrPresent-Han <chun.han@gmail.com>
This commit is contained in:
Chun Han 2025-03-25 10:08:19 +08:00 committed by GitHub
parent fe81c7baae
commit eee68e9139
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1560,6 +1560,13 @@ func (h *HandlersV2) createCollection(ctx context.Context, c *gin.Context, anyRe
Value: fmt.Sprintf("%v", httpReq.Params["partitionKeyIsolation"]), Value: fmt.Sprintf("%v", httpReq.Params["partitionKeyIsolation"]),
}) })
} }
if _, ok := httpReq.Params[common.MmapEnabledKey]; ok {
req.Properties = append(req.Properties, &commonpb.KeyValuePair{
Key: common.MmapEnabledKey,
Value: fmt.Sprintf("%v", httpReq.Params[common.MmapEnabledKey]),
})
}
resp, err := wrapperProxyWithLimit(ctx, c, req, h.checkAuth, false, "/milvus.proto.milvus.MilvusService/CreateCollection", true, h.proxy, func(reqCtx context.Context, req any) (interface{}, error) { resp, err := wrapperProxyWithLimit(ctx, c, req, h.checkAuth, false, "/milvus.proto.milvus.MilvusService/CreateCollection", true, h.proxy, func(reqCtx context.Context, req any) (interface{}, error) {
return h.proxy.CreateCollection(reqCtx, req.(*milvuspb.CreateCollectionRequest)) return h.proxy.CreateCollection(reqCtx, req.(*milvuspb.CreateCollectionRequest))
}) })