Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
e1187d9d
M
milvus
项目概览
milvus
/
milvus
9 个月 前同步成功
通知
260
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
e1187d9d
编写于
5月 26, 2023
作者:
C
cai.zhang
提交者:
GitHub
5月 26, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove constraint that cannot create index after load (#24415)
Signed-off-by:
N
cai.zhang
<
cai.zhang@zilliz.com
>
上级
fd25bd25
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
0 addition
and
70 deletion
+0
-70
internal/proxy/impl.go
internal/proxy/impl.go
+0
-1
internal/proxy/task_index.go
internal/proxy/task_index.go
+0
-9
internal/proxy/task_index_test.go
internal/proxy/task_index_test.go
+0
-49
internal/proxy/task_test.go
internal/proxy/task_test.go
+0
-11
未找到文件。
internal/proxy/impl.go
浏览文件 @
e1187d9d
...
...
@@ -2147,7 +2147,6 @@ func (node *Proxy) CreateIndex(ctx context.Context, request *milvuspb.CreateInde
req
:
request
,
rootCoord
:
node
.
rootCoord
,
indexCoord
:
node
.
indexCoord
,
queryCoord
:
node
.
queryCoord
,
}
method
:=
"CreateIndex"
...
...
internal/proxy/task_index.go
浏览文件 @
e1187d9d
...
...
@@ -55,7 +55,6 @@ type createIndexTask struct {
ctx
context
.
Context
rootCoord
types
.
RootCoord
indexCoord
types
.
IndexCoord
queryCoord
types
.
QueryCoord
result
*
commonpb
.
Status
isAutoIndex
bool
...
...
@@ -299,14 +298,6 @@ func (cit *createIndexTask) PreExecute(ctx context.Context) error {
return
err
}
loaded
,
err
:=
isCollectionLoaded
(
ctx
,
cit
.
queryCoord
,
collID
)
if
err
!=
nil
{
return
err
}
if
loaded
{
return
fmt
.
Errorf
(
"create index failed, collection is loaded, please release it first"
)
}
return
nil
}
...
...
internal/proxy/task_index_test.go
浏览文件 @
e1187d9d
...
...
@@ -245,60 +245,14 @@ func TestCreateIndexTask_PreExecute(t *testing.T) {
FieldName
:
fieldName
,
},
indexCoord
:
ic
,
queryCoord
:
nil
,
result
:
nil
,
collectionID
:
collectionID
,
}
t
.
Run
(
"normal"
,
func
(
t
*
testing
.
T
)
{
showCollectionMock
:=
func
(
ctx
context
.
Context
,
request
*
querypb
.
ShowCollectionsRequest
)
(
*
querypb
.
ShowCollectionsResponse
,
error
)
{
return
&
querypb
.
ShowCollectionsResponse
{
Status
:
&
commonpb
.
Status
{
ErrorCode
:
commonpb
.
ErrorCode_Success
,
},
CollectionIDs
:
[]
int64
{},
},
nil
}
qc
:=
NewQueryCoordMock
(
withValidShardLeaders
(),
SetQueryCoordShowCollectionsFunc
(
showCollectionMock
))
qc
.
updateState
(
commonpb
.
StateCode_Healthy
)
cit
.
queryCoord
=
qc
err
:=
cit
.
PreExecute
(
ctx
)
assert
.
NoError
(
t
,
err
)
})
t
.
Run
(
"coll has been loaded"
,
func
(
t
*
testing
.
T
)
{
showCollectionMock
:=
func
(
ctx
context
.
Context
,
request
*
querypb
.
ShowCollectionsRequest
)
(
*
querypb
.
ShowCollectionsResponse
,
error
)
{
return
&
querypb
.
ShowCollectionsResponse
{
Status
:
&
commonpb
.
Status
{
ErrorCode
:
commonpb
.
ErrorCode_Success
,
},
CollectionIDs
:
[]
int64
{
collectionID
},
},
nil
}
qc
:=
NewQueryCoordMock
(
withValidShardLeaders
(),
SetQueryCoordShowCollectionsFunc
(
showCollectionMock
))
qc
.
updateState
(
commonpb
.
StateCode_Healthy
)
cit
.
queryCoord
=
qc
err
:=
cit
.
PreExecute
(
ctx
)
assert
.
Error
(
t
,
err
)
})
t
.
Run
(
"check load error"
,
func
(
t
*
testing
.
T
)
{
showCollectionMock
:=
func
(
ctx
context
.
Context
,
request
*
querypb
.
ShowCollectionsRequest
)
(
*
querypb
.
ShowCollectionsResponse
,
error
)
{
return
&
querypb
.
ShowCollectionsResponse
{
Status
:
&
commonpb
.
Status
{
ErrorCode
:
commonpb
.
ErrorCode_UnexpectedError
,
Reason
:
"fail reason"
,
},
CollectionIDs
:
nil
,
},
errors
.
New
(
"error"
)
}
qc
:=
NewQueryCoordMock
(
withValidShardLeaders
(),
SetQueryCoordShowCollectionsFunc
(
showCollectionMock
))
qc
.
updateState
(
commonpb
.
StateCode_Healthy
)
cit
.
queryCoord
=
qc
err
:=
cit
.
PreExecute
(
ctx
)
assert
.
Error
(
t
,
err
)
})
}
func
Test_parseIndexParams
(
t
*
testing
.
T
)
{
...
...
@@ -332,7 +286,6 @@ func Test_parseIndexParams(t *testing.T) {
ctx
:
nil
,
rootCoord
:
nil
,
indexCoord
:
nil
,
queryCoord
:
nil
,
result
:
nil
,
isAutoIndex
:
false
,
newIndexParams
:
nil
,
...
...
@@ -418,7 +371,6 @@ func Test_parseIndexParams(t *testing.T) {
ctx
:
nil
,
rootCoord
:
nil
,
indexCoord
:
nil
,
queryCoord
:
nil
,
result
:
nil
,
isAutoIndex
:
false
,
newIndexParams
:
nil
,
...
...
@@ -512,7 +464,6 @@ func Test_parseIndexParams(t *testing.T) {
},
ctx
:
nil
,
rootCoord
:
nil
,
queryCoord
:
nil
,
result
:
nil
,
isAutoIndex
:
false
,
newIndexParams
:
nil
,
...
...
internal/proxy/task_test.go
浏览文件 @
e1187d9d
...
...
@@ -2587,17 +2587,6 @@ func Test_createIndexTask_PreExecute(t *testing.T) {
FieldName
:
fieldName
,
},
}
showCollectionMock
:=
func
(
ctx
context
.
Context
,
request
*
querypb
.
ShowCollectionsRequest
)
(
*
querypb
.
ShowCollectionsResponse
,
error
)
{
return
&
querypb
.
ShowCollectionsResponse
{
Status
:
&
commonpb
.
Status
{
ErrorCode
:
commonpb
.
ErrorCode_Success
,
},
CollectionIDs
:
[]
int64
{},
},
nil
}
qc
:=
NewQueryCoordMock
(
withValidShardLeaders
(),
SetQueryCoordShowCollectionsFunc
(
showCollectionMock
))
qc
.
updateState
(
commonpb
.
StateCode_Healthy
)
cit
.
queryCoord
=
qc
t
.
Run
(
"normal"
,
func
(
t
*
testing
.
T
)
{
cache
:=
NewMockCache
(
t
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录