Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
7746a5b7
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
7746a5b7
编写于
5月 20, 2022
作者:
Y
yah01
提交者:
GitHub
5月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add NodeIds field for QuerySegmentInfo (#17121)
Signed-off-by:
N
yah01
<
yang.cen@zilliz.com
>
上级
90ee23df
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
673 addition
and
535 deletion
+673
-535
internal/core/src/pb/milvus.pb.cc
internal/core/src/pb/milvus.pb.cc
+320
-249
internal/core/src/pb/milvus.pb.h
internal/core/src/pb/milvus.pb.h
+44
-0
internal/proto/milvus.proto
internal/proto/milvus.proto
+2
-0
internal/proto/milvuspb/milvus.pb.go
internal/proto/milvuspb/milvus.pb.go
+286
-276
internal/proto/query_coord.proto
internal/proto/query_coord.proto
+1
-0
internal/proto/querypb/query_coord.pb.go
internal/proto/querypb/query_coord.pb.go
+4
-3
internal/proxy/impl.go
internal/proxy/impl.go
+1
-1
internal/querycoord/task.go
internal/querycoord/task.go
+5
-6
internal/querycoord/task_scheduler.go
internal/querycoord/task_scheduler.go
+4
-0
tests/python_client/testcases/test_utility.py
tests/python_client/testcases/test_utility.py
+6
-0
未找到文件。
internal/core/src/pb/milvus.pb.cc
浏览文件 @
7746a5b7
此差异已折叠。
点击以展开。
internal/core/src/pb/milvus.pb.h
浏览文件 @
7746a5b7
...
...
@@ -10539,6 +10539,7 @@ class QuerySegmentInfo :
// accessors -------------------------------------------------------
enum : int {
kNodeIdsFieldNumber = 10,
kIndexNameFieldNumber = 6,
kSegmentIDFieldNumber = 1,
kCollectionIDFieldNumber = 2,
...
...
@@ -10549,6 +10550,17 @@ class QuerySegmentInfo :
kNodeIDFieldNumber = 8,
kStateFieldNumber = 9,
};
// repeated int64 nodeIds = 10;
int nodeids_size() const;
void clear_nodeids();
::PROTOBUF_NAMESPACE_ID::int64 nodeids(int index) const;
void set_nodeids(int index, ::PROTOBUF_NAMESPACE_ID::int64 value);
void add_nodeids(::PROTOBUF_NAMESPACE_ID::int64 value);
const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >&
nodeids() const;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >*
mutable_nodeids();
// string index_name = 6;
void clear_index_name();
const std::string& index_name() const;
...
...
@@ -10605,6 +10617,8 @@ class QuerySegmentInfo :
class _Internal;
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > nodeids_;
mutable std::atomic<int> _nodeids_cached_byte_size_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr index_name_;
::PROTOBUF_NAMESPACE_ID::int64 segmentid_;
::PROTOBUF_NAMESPACE_ID::int64 collectionid_;
...
...
@@ -25863,6 +25877,36 @@ inline void QuerySegmentInfo::set_state(::milvus::proto::common::SegmentState va
// @@protoc_insertion_point(field_set:milvus.proto.milvus.QuerySegmentInfo.state)
}
// repeated int64 nodeIds = 10;
inline int QuerySegmentInfo::nodeids_size() const {
return nodeids_.size();
}
inline void QuerySegmentInfo::clear_nodeids() {
nodeids_.Clear();
}
inline ::PROTOBUF_NAMESPACE_ID::int64 QuerySegmentInfo::nodeids(int index) const {
// @@protoc_insertion_point(field_get:milvus.proto.milvus.QuerySegmentInfo.nodeIds)
return nodeids_.Get(index);
}
inline void QuerySegmentInfo::set_nodeids(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) {
nodeids_.Set(index, value);
// @@protoc_insertion_point(field_set:milvus.proto.milvus.QuerySegmentInfo.nodeIds)
}
inline void QuerySegmentInfo::add_nodeids(::PROTOBUF_NAMESPACE_ID::int64 value) {
nodeids_.Add(value);
// @@protoc_insertion_point(field_add:milvus.proto.milvus.QuerySegmentInfo.nodeIds)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >&
QuerySegmentInfo::nodeids() const {
// @@protoc_insertion_point(field_list:milvus.proto.milvus.QuerySegmentInfo.nodeIds)
return nodeids_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >*
QuerySegmentInfo::mutable_nodeids() {
// @@protoc_insertion_point(field_mutable_list:milvus.proto.milvus.QuerySegmentInfo.nodeIds)
return &nodeids_;
}
// -------------------------------------------------------------------
// GetQuerySegmentInfoRequest
internal/proto/milvus.proto
浏览文件 @
7746a5b7
...
...
@@ -708,8 +708,10 @@ message QuerySegmentInfo {
int64
num_rows
=
5
;
string
index_name
=
6
;
int64
indexID
=
7
;
// deprecated, check node_ids(NodeIds) field
int64
nodeID
=
8
;
common.SegmentState
state
=
9
;
repeated
int64
nodeIds
=
10
;
}
message
GetQuerySegmentInfoRequest
{
...
...
internal/proto/milvuspb/milvus.pb.go
浏览文件 @
7746a5b7
此差异已折叠。
点击以展开。
internal/proto/query_coord.proto
浏览文件 @
7746a5b7
...
...
@@ -354,6 +354,7 @@ message SegmentInfo {
int64
segmentID
=
1
;
int64
collectionID
=
2
;
int64
partitionID
=
3
;
// deprecated, check node_ids(NodeIds) field
int64
nodeID
=
4
;
int64
mem_size
=
5
;
int64
num_rows
=
6
;
...
...
internal/proto/querypb/query_coord.pb.go
浏览文件 @
7746a5b7
...
...
@@ -2471,9 +2471,10 @@ func (m *PartitionStates) GetInMemoryPercentage() int64 {
}
type
SegmentInfo
struct
{
SegmentID
int64
`protobuf:"varint,1,opt,name=segmentID,proto3" json:"segmentID,omitempty"`
CollectionID
int64
`protobuf:"varint,2,opt,name=collectionID,proto3" json:"collectionID,omitempty"`
PartitionID
int64
`protobuf:"varint,3,opt,name=partitionID,proto3" json:"partitionID,omitempty"`
SegmentID
int64
`protobuf:"varint,1,opt,name=segmentID,proto3" json:"segmentID,omitempty"`
CollectionID
int64
`protobuf:"varint,2,opt,name=collectionID,proto3" json:"collectionID,omitempty"`
PartitionID
int64
`protobuf:"varint,3,opt,name=partitionID,proto3" json:"partitionID,omitempty"`
// deprecated, check node_ids(NodeIds) field
NodeID
int64
`protobuf:"varint,4,opt,name=nodeID,proto3" json:"nodeID,omitempty"`
MemSize
int64
`protobuf:"varint,5,opt,name=mem_size,json=memSize,proto3" json:"mem_size,omitempty"`
NumRows
int64
`protobuf:"varint,6,opt,name=num_rows,json=numRows,proto3" json:"num_rows,omitempty"`
...
...
internal/proxy/impl.go
浏览文件 @
7746a5b7
...
...
@@ -3594,8 +3594,8 @@ func (node *Proxy) GetQuerySegmentInfo(ctx context.Context, req *milvuspb.GetQue
MemSize
:
info
.
MemSize
,
IndexName
:
info
.
IndexName
,
IndexID
:
info
.
IndexID
,
NodeID
:
info
.
NodeID
,
State
:
info
.
SegmentState
,
NodeIds
:
info
.
NodeIds
,
}
}
resp
.
Status
.
ErrorCode
=
commonpb
.
ErrorCode_Success
...
...
internal/querycoord/task.go
浏览文件 @
7746a5b7
...
...
@@ -2296,12 +2296,6 @@ func (lbt *loadBalanceTask) globalPostExecute(ctx context.Context) error {
offlineNodes
.
Insert
(
nodeID
)
}
log
.
Debug
(
"removing offline nodes from replicas and segments..."
,
zap
.
Int
(
"len(replicas)"
,
len
(
replicas
)),
zap
.
Int
(
"len(segments)"
,
len
(
segments
)),
zap
.
Int64
(
"trigger task ID"
,
lbt
.
getTaskID
()),
)
for
_
,
replica
:=
range
replicas
{
replica
:=
replica
wg
.
Go
(
func
()
error
{
...
...
@@ -2344,6 +2338,11 @@ func (lbt *loadBalanceTask) globalPostExecute(ctx context.Context) error {
return
err
}
log
.
Info
(
"remove offline nodes from segment"
,
zap
.
Int64
(
"taskID"
,
lbt
.
getTaskID
()),
zap
.
Int64
(
"segmentID"
,
segment
.
GetSegmentID
()),
zap
.
Int64s
(
"nodeIds"
,
segment
.
GetNodeIds
()))
return
nil
})
}
...
...
internal/querycoord/task_scheduler.go
浏览文件 @
7746a5b7
...
...
@@ -967,6 +967,10 @@ func updateSegmentInfoFromTask(ctx context.Context, triggerTask task, meta Meta)
}
}
}
log
.
Info
(
"update segment info"
,
zap
.
Int64
(
"triggerTaskID"
,
triggerTask
.
getTaskID
()),
zap
.
Any
(
"segment"
,
segmentInfosToSave
))
sealedSegmentChangeInfos
,
err
=
meta
.
saveGlobalSealedSegInfos
(
segmentInfosToSave
)
}
...
...
tests/python_client/testcases/test_utility.py
浏览文件 @
7746a5b7
...
...
@@ -1516,6 +1516,7 @@ class TestUtilityAdvanced(TestcaseBase):
assert
cnt
==
nb
@
pytest
.
mark
.
tags
(
CaseLabel
.
L3
)
@
pytest
.
mark
.
xfail
(
reason
=
"need newer SDK"
)
def
test_load_balance_normal
(
self
):
"""
target: test load balance of collection
...
...
@@ -1557,6 +1558,7 @@ class TestUtilityAdvanced(TestcaseBase):
assert
set
(
sealed_segment_ids
).
issubset
(
des_sealed_segment_ids
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
@
pytest
.
mark
.
xfail
(
reason
=
"need newer SDK"
)
def
test_load_balance_with_src_node_not_exist
(
self
):
"""
target: test load balance of collection
...
...
@@ -1593,6 +1595,7 @@ class TestUtilityAdvanced(TestcaseBase):
check_items
=
{
ct
.
err_code
:
1
,
ct
.
err_msg
:
"is not exist to balance"
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
@
pytest
.
mark
.
xfail
(
reason
=
"need newer SDK"
)
def
test_load_balance_with_all_dst_node_not_exist
(
self
):
"""
target: test load balance of collection
...
...
@@ -1628,6 +1631,7 @@ class TestUtilityAdvanced(TestcaseBase):
check_items
=
{
ct
.
err_code
:
1
,
ct
.
err_msg
:
"no available queryNode to allocate"
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
@
pytest
.
mark
.
xfail
(
reason
=
"need newer SDK"
)
def
test_load_balance_with_one_sealed_segment_id_not_exist
(
self
):
"""
target: test load balance of collection
...
...
@@ -1668,6 +1672,7 @@ class TestUtilityAdvanced(TestcaseBase):
check_items
=
{
ct
.
err_code
:
1
,
ct
.
err_msg
:
"is not exist"
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L3
)
@
pytest
.
mark
.
xfail
(
reason
=
"need newer SDK"
)
def
test_load_balance_in_one_group
(
self
):
"""
target: test load balance of collection in one group
...
...
@@ -1715,6 +1720,7 @@ class TestUtilityAdvanced(TestcaseBase):
assert
set
(
sealed_segment_ids
).
issubset
(
des_sealed_segment_ids
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L3
)
@
pytest
.
mark
.
xfail
(
reason
=
"need newer SDK"
)
def
test_load_balance_not_in_one_group
(
self
):
"""
target: test load balance of collection in one group
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录