From eee68e9139a9fd2bc1f78f62a2bf8a958a5fae46 Mon Sep 17 00:00:00 2001 From: Chun Han <116052805+MrPresent-Han@users.noreply.github.com> Date: Tue, 25 Mar 2025 10:08:19 +0800 Subject: [PATCH] fix: mmap properties failed to apply when creating collection(#40511) (#40512) related: #40511 Signed-off-by: MrPresent-Han Co-authored-by: MrPresent-Han --- internal/distributed/proxy/httpserver/handler_v2.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/distributed/proxy/httpserver/handler_v2.go b/internal/distributed/proxy/httpserver/handler_v2.go index 0139d441d2..a2b24b63fb 100644 --- a/internal/distributed/proxy/httpserver/handler_v2.go +++ b/internal/distributed/proxy/httpserver/handler_v2.go @@ -1560,6 +1560,13 @@ func (h *HandlersV2) createCollection(ctx context.Context, c *gin.Context, anyRe 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) { return h.proxy.CreateCollection(reqCtx, req.(*milvuspb.CreateCollectionRequest)) })