mirror of https://github.com/milvus-io/milvus.git
Set GetIndexBuildProgress is compatible with SDK version 2.1 (#21622)
Signed-off-by: cai.zhang <cai.zhang@zilliz.com>pull/21509/head
parent
e127cf7b99
commit
f02ccfb422
|
@ -403,6 +403,15 @@ func (s *Server) GetIndexBuildProgress(ctx context.Context, req *indexpb.GetInde
|
|||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
if len(indexes) > 1 {
|
||||
log.Warn(msgAmbiguousIndexName())
|
||||
errResp.ErrorCode = commonpb.ErrorCode_UnexpectedError
|
||||
errResp.Reason = msgAmbiguousIndexName()
|
||||
return &indexpb.GetIndexBuildProgressResponse{
|
||||
Status: errResp,
|
||||
}, nil
|
||||
}
|
||||
indexInfo := &indexpb.IndexInfo{
|
||||
IndexedRows: 0,
|
||||
TotalRows: 0,
|
||||
|
|
|
@ -543,6 +543,40 @@ func TestServer_GetIndexBuildProgress(t *testing.T) {
|
|||
assert.Equal(t, int64(10250), resp.GetTotalRows())
|
||||
assert.Equal(t, int64(10250), resp.GetIndexedRows())
|
||||
})
|
||||
|
||||
t.Run("multiple index", func(t *testing.T) {
|
||||
s.meta.indexes[collID] = map[UniqueID]*model.Index{
|
||||
indexID: {
|
||||
TenantID: "",
|
||||
CollectionID: collID,
|
||||
FieldID: fieldID,
|
||||
IndexID: indexID,
|
||||
IndexName: indexName,
|
||||
IsDeleted: false,
|
||||
CreateTime: createTS,
|
||||
TypeParams: typeParams,
|
||||
IndexParams: indexParams,
|
||||
IsAutoIndex: false,
|
||||
UserIndexParams: nil,
|
||||
},
|
||||
indexID + 1: {
|
||||
TenantID: "",
|
||||
CollectionID: collID,
|
||||
FieldID: fieldID + 1,
|
||||
IndexID: indexID + 1,
|
||||
IndexName: "_default_idx_102",
|
||||
IsDeleted: false,
|
||||
CreateTime: 0,
|
||||
TypeParams: nil,
|
||||
IndexParams: nil,
|
||||
IsAutoIndex: false,
|
||||
UserIndexParams: nil,
|
||||
},
|
||||
}
|
||||
resp, err := s.GetIndexBuildProgress(ctx, req)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, commonpb.ErrorCode_UnexpectedError, resp.GetStatus().GetErrorCode())
|
||||
})
|
||||
}
|
||||
|
||||
func TestServer_DescribeIndex(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue