Skip to content

Commit

Permalink
fix: merge index params when creating index (milvus-io#31127)
Browse files Browse the repository at this point in the history
issue: milvus-io#31102

---------

Signed-off-by: sunby <[email protected]>
  • Loading branch information
sunby authored Mar 11, 2024
1 parent 6a9418d commit 5c0bb40
Show file tree
Hide file tree
Showing 5 changed files with 303 additions and 290 deletions.
13 changes: 13 additions & 0 deletions internal/datacoord/index_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,19 @@ func (s *Server) CreateIndex(ctx context.Context, req *indexpb.CreateIndexReques
return merr.Status(err), nil
}

// merge with previous params because create index would not pass mmap params
indexes := s.meta.indexMeta.GetFieldIndexes(req.GetCollectionID(), req.GetFieldID(), req.GetIndexName())
if len(indexes) == 1 {
req.UserIndexParams, err = UpdateParams(indexes[0], indexes[0].UserIndexParams, req.GetUserIndexParams())
if err != nil {
return merr.Status(err), nil
}
req.IndexParams, err = UpdateParams(indexes[0], indexes[0].IndexParams, req.GetIndexParams())
if err != nil {
return merr.Status(err), nil
}
}

if indexID == 0 {
indexID, err = s.allocator.allocID(ctx)
if err != nil {
Expand Down
106 changes: 53 additions & 53 deletions internal/metastore/mocks/mock_datacoord_catalog.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5c0bb40

Please sign in to comment.