Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
bb2ad23e
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,发现更多精彩内容 >>
未验证
提交
bb2ad23e
编写于
7月 14, 2022
作者:
Y
yah01
提交者:
GitHub
7月 14, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
GetQuerySegmentInfo returns sealed loaded segments (#18255)
Signed-off-by:
N
yah01
<
yang.cen@zilliz.com
>
上级
93d9dfad
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
68 deletion
+10
-68
internal/querycoord/cluster.go
internal/querycoord/cluster.go
+1
-34
internal/querycoord/cluster_test.go
internal/querycoord/cluster_test.go
+3
-28
internal/querycoord/impl.go
internal/querycoord/impl.go
+4
-4
tests/python_client/testcases/test_delete.py
tests/python_client/testcases/test_delete.py
+2
-2
未找到文件。
internal/querycoord/cluster.go
浏览文件 @
bb2ad23e
...
...
@@ -466,43 +466,10 @@ func (c *queryNodeCluster) GetSegmentInfo(ctx context.Context, in *querypb.GetSe
}
}
// Fetch growing segments
c
.
RLock
()
var
wg
sync
.
WaitGroup
cnt
:=
len
(
c
.
nodes
)
resChan
:=
make
(
chan
respTuple
,
cnt
)
wg
.
Add
(
cnt
)
for
_
,
node
:=
range
c
.
nodes
{
go
func
(
node
Node
)
{
defer
wg
.
Done
()
res
,
err
:=
node
.
getSegmentInfo
(
ctx
,
in
)
resChan
<-
respTuple
{
res
:
res
,
err
:
err
,
}
}(
node
)
}
c
.
RUnlock
()
wg
.
Wait
()
close
(
resChan
)
for
tuple
:=
range
resChan
{
if
tuple
.
err
!=
nil
{
return
nil
,
tuple
.
err
}
segments
:=
tuple
.
res
.
GetInfos
()
for
_
,
segment
:=
range
segments
{
if
segment
.
SegmentState
!=
commonpb
.
SegmentState_Sealed
{
segmentInfos
=
append
(
segmentInfos
,
segment
)
}
}
}
//TODO::update meta
return
segmentInfos
,
nil
}
// Deprecated
func
(
c
*
queryNodeCluster
)
GetSegmentInfoByNode
(
ctx
context
.
Context
,
nodeID
int64
,
in
*
querypb
.
GetSegmentInfoRequest
)
([]
*
querypb
.
SegmentInfo
,
error
)
{
c
.
RLock
()
node
,
ok
:=
c
.
nodes
[
nodeID
]
...
...
internal/querycoord/cluster_test.go
浏览文件 @
bb2ad23e
...
...
@@ -549,43 +549,18 @@ func TestGrpcRequest(t *testing.T) {
assert
.
Nil
(
t
,
err
)
})
t
.
Run
(
"Test GetSegmentInfoByNode"
,
func
(
t
*
testing
.
T
)
{
getSegmentInfoReq
:=
&
querypb
.
GetSegmentInfoRequest
{
Base
:
&
commonpb
.
MsgBase
{
MsgType
:
commonpb
.
MsgType_SegmentInfo
,
},
CollectionID
:
defaultCollectionID
,
}
_
,
err
=
cluster
.
GetSegmentInfoByNode
(
baseCtx
,
nodeID
,
getSegmentInfoReq
)
assert
.
Nil
(
t
,
err
)
})
node
.
getSegmentInfos
=
returnFailedGetSegmentInfoResult
t
.
Run
(
"Test GetSegmentInfoFailed"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"Test GetSegmentInfoNotExist"
,
func
(
t
*
testing
.
T
)
{
getSegmentInfoReq
:=
&
querypb
.
GetSegmentInfoRequest
{
Base
:
&
commonpb
.
MsgBase
{
MsgType
:
commonpb
.
MsgType_SegmentInfo
,
},
CollectionID
:
defaultCollectionID
,
SegmentIDs
:
[]
UniqueID
{
-
1
},
}
_
,
err
=
cluster
.
GetSegmentInfo
(
baseCtx
,
getSegmentInfoReq
)
assert
.
NotNil
(
t
,
err
)
assert
.
Error
(
t
,
err
)
})
t
.
Run
(
"Test GetSegmentInfoByNodeFailed"
,
func
(
t
*
testing
.
T
)
{
getSegmentInfoReq
:=
&
querypb
.
GetSegmentInfoRequest
{
Base
:
&
commonpb
.
MsgBase
{
MsgType
:
commonpb
.
MsgType_SegmentInfo
,
},
CollectionID
:
defaultCollectionID
,
}
_
,
err
=
cluster
.
GetSegmentInfoByNode
(
baseCtx
,
nodeID
,
getSegmentInfoReq
)
assert
.
NotNil
(
t
,
err
)
})
node
.
getSegmentInfos
=
returnSuccessGetSegmentInfoResult
t
.
Run
(
"Test GetNodeInfoByID"
,
func
(
t
*
testing
.
T
)
{
res
,
err
:=
cluster
.
GetNodeInfoByID
(
nodeID
)
assert
.
Nil
(
t
,
err
)
...
...
internal/querycoord/impl.go
浏览文件 @
bb2ad23e
...
...
@@ -809,9 +809,7 @@ func (qc *QueryCoord) GetSegmentInfo(ctx context.Context, req *querypb.GetSegmen
totalMemSize
:=
int64
(
0
)
totalNumRows
:=
int64
(
0
)
//TODO::get segment infos from MetaReplica
//segmentIDs := req.SegmentIDs
//segmentInfos, err := qs.MetaReplica.getSegmentInfos(segmentIDs)
segmentInfos
,
err
:=
qc
.
cluster
.
GetSegmentInfo
(
ctx
,
req
)
if
err
!=
nil
{
status
.
ErrorCode
=
commonpb
.
ErrorCode_UnexpectedError
...
...
@@ -836,7 +834,9 @@ func (qc *QueryCoord) GetSegmentInfo(ctx context.Context, req *querypb.GetSegmen
zap
.
Int64
(
"collectionID"
,
req
.
CollectionID
),
zap
.
Int64
(
"msgID"
,
req
.
Base
.
MsgID
),
zap
.
Int64
(
"num rows"
,
totalNumRows
),
zap
.
Int64
(
"memory size"
,
totalMemSize
))
zap
.
Int64
(
"memory size"
,
totalMemSize
),
zap
.
Int
(
"segmentNum"
,
len
(
segmentInfos
)))
return
&
querypb
.
GetSegmentInfoResponse
{
Status
:
status
,
Infos
:
segmentInfos
,
...
...
tests/python_client/testcases/test_delete.py
浏览文件 @
bb2ad23e
...
...
@@ -968,7 +968,7 @@ class TestDeleteOperation(TestcaseBase):
while
True
:
time
.
sleep
(
0.5
)
segment_infos
=
self
.
utility_wrap
.
get_query_segment_info
(
collection_w
.
name
)[
0
]
if
segment_infos
[
0
].
state
==
SegmentState
.
Sealed
:
if
len
(
segment_infos
)
>
0
and
segment_infos
[
0
].
state
==
SegmentState
.
Sealed
:
break
# query deleted id
collection_w
.
query
(
tmp_expr
,
check_task
=
CheckTasks
.
check_query_empty
)
...
...
@@ -1580,7 +1580,7 @@ class TestDeleteString(TestcaseBase):
while
True
:
time
.
sleep
(
0.5
)
segment_infos
=
self
.
utility_wrap
.
get_query_segment_info
(
collection_w
.
name
)[
0
]
if
segment_infos
[
0
].
state
==
SegmentState
.
Sealed
:
if
len
(
segment_infos
)
>
0
and
segment_infos
[
0
].
state
==
SegmentState
.
Sealed
:
break
# query deleted id
collection_w
.
query
(
default_string_expr
,
check_task
=
CheckTasks
.
check_query_empty
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录