Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
941891a3
M
milvus
项目概览
milvus
/
milvus
大约 1 年 前同步成功
通知
261
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,发现更多精彩内容 >>
未验证
提交
941891a3
编写于
1月 11, 2023
作者:
Z
zhenshan.cao
提交者:
GitHub
1月 11, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Ban AutoIndex on BinaryVector (#21381)
Signed-off-by:
N
zhenshan.cao
<
zhenshan.cao@zilliz.com
>
上级
ffbfce6e
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
335 addition
and
403 deletion
+335
-403
internal/indexcoord/task.go
internal/indexcoord/task.go
+8
-0
internal/proto/index_coord.proto
internal/proto/index_coord.proto
+2
-0
internal/proto/indexpb/index_coord.pb.go
internal/proto/indexpb/index_coord.pb.go
+149
-138
internal/proto/internal.proto
internal/proto/internal.proto
+0
-11
internal/proto/internalpb/internal.pb.go
internal/proto/internalpb/internal.pb.go
+154
-253
internal/proxy/task.go
internal/proxy/task.go
+3
-0
internal/proxy/task_index.go
internal/proxy/task_index.go
+6
-0
internal/rootcoord/create_collection_task.go
internal/rootcoord/create_collection_task.go
+13
-1
未找到文件。
internal/indexcoord/task.go
浏览文件 @
941891a3
...
...
@@ -19,6 +19,9 @@ package indexcoord
import
(
"context"
"errors"
"fmt"
"github.com/milvus-io/milvus-proto/go-api/schemapb"
"go.uber.org/zap"
...
...
@@ -131,6 +134,11 @@ func (cit *CreateIndexTask) PreExecute(ctx context.Context) error {
if
getIndexType
(
cit
.
req
.
GetIndexParams
())
==
diskAnnIndex
&&
!
cit
.
indexCoordClient
.
nodeManager
.
ClientSupportDisk
()
{
return
errors
.
New
(
"all IndexNodes do not support disk indexes, please verify"
)
}
if
cit
.
req
.
GetFieldDataType
()
==
schemapb
.
DataType_BinaryVector
&&
Params
.
AutoIndexConfig
.
Enable
{
return
fmt
.
Errorf
(
"can not create AutoIndex on binary vector"
)
}
return
nil
}
...
...
internal/proto/index_coord.proto
浏览文件 @
941891a3
...
...
@@ -5,6 +5,7 @@ package milvus.proto.index;
option
go_package
=
"github.com/milvus-io/milvus/internal/proto/indexpb"
;
import
"common.proto"
;
import
"schema.proto"
;
import
"internal.proto"
;
import
"milvus.proto"
;
...
...
@@ -131,6 +132,7 @@ message CreateIndexRequest {
uint64
timestamp
=
6
;
bool
is_auto_index
=
7
;
repeated
common.KeyValuePair
user_index_params
=
8
;
schema.DataType
fieldDataType
=
9
;
}
message
GetIndexInfoRequest
{
...
...
internal/proto/indexpb/index_coord.pb.go
浏览文件 @
941891a3
此差异已折叠。
点击以展开。
internal/proto/internal.proto
浏览文件 @
941891a3
...
...
@@ -117,17 +117,6 @@ message AlterAliasRequest{
string
alias
=
4
;
}
message
CreateIndexRequest
{
common.MsgBase
base
=
1
;
string
db_name
=
2
;
string
collection_name
=
3
;
string
field_name
=
4
;
int64
dbID
=
5
;
int64
collectionID
=
6
;
int64
fieldID
=
7
;
repeated
common.KeyValuePair
extra_params
=
8
;
}
enum
InsertDataVersion
{
// 0 must refer to row-based format, since it's the first version in Milvus.
RowBased
=
0
;
...
...
internal/proto/internalpb/internal.pb.go
浏览文件 @
941891a3
此差异已折叠。
点击以展开。
internal/proxy/task.go
浏览文件 @
941891a3
...
...
@@ -202,6 +202,9 @@ func (cct *createCollectionTask) PreExecute(ctx context.Context) error {
if
err
!=
nil
{
return
err
}
if
Params
.
AutoIndexConfig
.
Enable
&&
field
.
DataType
==
schemapb
.
DataType_BinaryVector
{
return
fmt
.
Errorf
(
"can not speficy binary vector when enabled with AutoIndex"
)
}
}
// valid max length per row parameters
// if max_length not specified, return error
...
...
internal/proxy/task_index.go
浏览文件 @
941891a3
...
...
@@ -282,6 +282,11 @@ func (cit *createIndexTask) PreExecute(ctx context.Context) error {
if
err
!=
nil
{
return
err
}
if
field
.
GetDataType
()
==
schemapb
.
DataType_BinaryVector
&&
Params
.
AutoIndexConfig
.
Enable
{
return
fmt
.
Errorf
(
"can not create AutoIndex on binary vector"
)
}
cit
.
fieldSchema
=
field
// check index param, not accurate, only some static rules
err
=
cit
.
parseIndexParams
()
...
...
@@ -318,6 +323,7 @@ func (cit *createIndexTask) Execute(ctx context.Context) error {
IsAutoIndex
:
cit
.
isAutoIndex
,
UserIndexParams
:
cit
.
req
.
GetExtraParams
(),
Timestamp
:
cit
.
BeginTs
(),
FieldDataType
:
cit
.
fieldSchema
.
GetDataType
(),
}
cit
.
result
,
err
=
cit
.
indexCoord
.
CreateIndex
(
ctx
,
req
)
if
err
!=
nil
{
...
...
internal/rootcoord/create_collection_task.go
浏览文件 @
941891a3
...
...
@@ -54,7 +54,6 @@ func (t *createCollectionTask) validate() error {
if
t
.
Req
.
GetShardsNum
()
>=
maxShardNum
{
return
fmt
.
Errorf
(
"shard num (%d) exceeds limit (%d)"
,
t
.
Req
.
GetShardsNum
(),
maxShardNum
)
}
return
nil
}
...
...
@@ -67,6 +66,15 @@ func hasSystemFields(schema *schemapb.CollectionSchema, systemFields []string) b
return
false
}
func
hasBinaryVecField
(
schema
*
schemapb
.
CollectionSchema
)
bool
{
for
_
,
field
:=
range
schema
.
GetFields
()
{
if
field
.
GetDataType
()
==
schemapb
.
DataType_BinaryVector
{
return
true
}
}
return
false
}
func
(
t
*
createCollectionTask
)
validateSchema
(
schema
*
schemapb
.
CollectionSchema
)
error
{
if
t
.
Req
.
GetCollectionName
()
!=
schema
.
GetName
()
{
return
fmt
.
Errorf
(
"collection name = %s, schema.Name=%s"
,
t
.
Req
.
GetCollectionName
(),
schema
.
Name
)
...
...
@@ -74,6 +82,10 @@ func (t *createCollectionTask) validateSchema(schema *schemapb.CollectionSchema)
if
hasSystemFields
(
schema
,
[]
string
{
RowIDFieldName
,
TimeStampFieldName
})
{
return
fmt
.
Errorf
(
"schema contains system field: %s, %s"
,
RowIDFieldName
,
TimeStampFieldName
)
}
if
Params
.
AutoIndexConfig
.
Enable
&&
hasBinaryVecField
(
schema
)
{
return
fmt
.
Errorf
(
"can not speficy binary vector when enabled with AutoIndex"
)
}
return
nil
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录