Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
b92ff69c
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,发现更多精彩内容 >>
提交
b92ff69c
编写于
2月 04, 2021
作者:
D
dragondriver
提交者:
yefu.chen
2月 04, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implement GetIndexState in Proxy
Signed-off-by:
N
dragondriver
<
jiquan.long@zilliz.com
>
上级
bc7ad02d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
115 addition
and
24 deletion
+115
-24
internal/proxynode/impl.go
internal/proxynode/impl.go
+4
-2
internal/proxynode/interface.go
internal/proxynode/interface.go
+1
-0
internal/proxynode/task.go
internal/proxynode/task.go
+91
-7
internal/querynode/flow_graph_gc_node.go
internal/querynode/flow_graph_gc_node.go
+19
-15
未找到文件。
internal/proxynode/impl.go
浏览文件 @
b92ff69c
...
...
@@ -442,8 +442,10 @@ func (node *NodeImpl) GetIndexState(request *milvuspb.IndexStateRequest) (*milvu
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
reqTimeoutInterval
)
defer
cancel
()
dipt
:=
&
GetIndexStateTask
{
Condition
:
NewTaskCondition
(
ctx
),
IndexStateRequest
:
request
,
Condition
:
NewTaskCondition
(
ctx
),
IndexStateRequest
:
request
,
indexServiceClient
:
node
.
indexServiceClient
,
masterClientInterface
:
node
.
masterClient
,
}
err
:=
node
.
sched
.
DdQueue
.
Enqueue
(
dipt
)
...
...
internal/proxynode/interface.go
浏览文件 @
b92ff69c
...
...
@@ -23,6 +23,7 @@ type MasterClient interface {
CreateIndex
(
in
*
milvuspb
.
CreateIndexRequest
)
(
*
commonpb
.
Status
,
error
)
DescribeIndex
(
in
*
milvuspb
.
DescribeIndexRequest
)
(
*
milvuspb
.
DescribeIndexResponse
,
error
)
ShowSegments
(
in
*
milvuspb
.
ShowSegmentRequest
)
(
*
milvuspb
.
ShowSegmentResponse
,
error
)
DescribeSegment
(
in
*
milvuspb
.
DescribeSegmentRequest
)
(
*
milvuspb
.
DescribeSegmentResponse
,
error
)
}
type
IndexServiceClient
interface
{
...
...
internal/proxynode/task.go
浏览文件 @
b92ff69c
...
...
@@ -6,6 +6,8 @@ import (
"math"
"strconv"
"github.com/zilliztech/milvus-distributed/internal/proto/indexpb"
"github.com/zilliztech/milvus-distributed/internal/proto/datapb"
"github.com/golang/protobuf/proto"
...
...
@@ -1285,8 +1287,9 @@ func (dit *DescribeIndexTask) PostExecute() error {
type
GetIndexStateTask
struct
{
Condition
*
milvuspb
.
IndexStateRequest
indexServiceClient
IndexServiceClient
result
*
milvuspb
.
IndexStateResponse
indexServiceClient
IndexServiceClient
masterClientInterface
MasterClient
result
*
milvuspb
.
IndexStateResponse
}
func
(
dipt
*
GetIndexStateTask
)
OnEnqueue
()
error
{
...
...
@@ -1336,17 +1339,98 @@ func (dipt *GetIndexStateTask) PreExecute() error {
}
func
(
dipt
*
GetIndexStateTask
)
Execute
()
error
{
// TODO: use index service client
//var err error
//dipt.result, err = dipt.masterClient.GetIndexState(dipt.IndexStateRequest)
//return err
collectionName
:=
dipt
.
CollectionName
collectionID
,
err
:=
globalMetaCache
.
GetCollectionID
(
collectionName
)
if
err
!=
nil
{
// err is not nil if collection not exists
return
err
}
showPartitionRequest
:=
&
milvuspb
.
ShowPartitionRequest
{
Base
:
&
commonpb
.
MsgBase
{
MsgType
:
commonpb
.
MsgType_kShowPartitions
,
MsgID
:
dipt
.
Base
.
MsgID
,
Timestamp
:
dipt
.
Base
.
Timestamp
,
SourceID
:
Params
.
ProxyID
,
},
DbName
:
dipt
.
DbName
,
CollectionName
:
collectionName
,
CollectionID
:
collectionID
,
}
partitions
,
err
:=
dipt
.
masterClientInterface
.
ShowPartitions
(
showPartitionRequest
)
if
err
!=
nil
{
return
err
}
for
_
,
partitionID
:=
range
partitions
.
PartitionIDs
{
showSegmentsRequest
:=
&
milvuspb
.
ShowSegmentRequest
{
Base
:
&
commonpb
.
MsgBase
{
MsgType
:
commonpb
.
MsgType_kShowSegment
,
MsgID
:
dipt
.
Base
.
MsgID
,
Timestamp
:
dipt
.
Base
.
Timestamp
,
SourceID
:
Params
.
ProxyID
,
},
CollectionID
:
collectionID
,
PartitionID
:
partitionID
,
}
segments
,
err
:=
dipt
.
masterClientInterface
.
ShowSegments
(
showSegmentsRequest
)
if
err
!=
nil
{
return
err
}
getIndexStatesRequest
:=
&
indexpb
.
IndexStatesRequest
{
IndexBuildIDs
:
make
([]
UniqueID
,
0
),
}
for
_
,
segmentID
:=
range
segments
.
SegmentIDs
{
describeSegmentRequest
:=
&
milvuspb
.
DescribeSegmentRequest
{
Base
:
&
commonpb
.
MsgBase
{
MsgType
:
commonpb
.
MsgType_kDescribeSegment
,
MsgID
:
dipt
.
Base
.
MsgID
,
Timestamp
:
dipt
.
Base
.
Timestamp
,
SourceID
:
Params
.
ProxyID
,
},
CollectionID
:
collectionID
,
SegmentID
:
segmentID
,
}
segmentDesc
,
err
:=
dipt
.
masterClientInterface
.
DescribeSegment
(
describeSegmentRequest
)
if
err
!=
nil
{
return
err
}
getIndexStatesRequest
.
IndexBuildIDs
=
append
(
getIndexStatesRequest
.
IndexBuildIDs
,
segmentDesc
.
BuildID
)
}
states
,
err
:=
dipt
.
indexServiceClient
.
GetIndexStates
(
getIndexStatesRequest
)
if
err
!=
nil
{
return
err
}
if
states
.
Status
.
ErrorCode
!=
commonpb
.
ErrorCode_SUCCESS
{
dipt
.
result
=
&
milvuspb
.
IndexStateResponse
{
Status
:
states
.
Status
,
State
:
commonpb
.
IndexState_FAILED
,
}
return
nil
}
for
_
,
state
:=
range
states
.
States
{
if
state
.
State
!=
commonpb
.
IndexState_FINISHED
{
dipt
.
result
=
&
milvuspb
.
IndexStateResponse
{
Status
:
states
.
Status
,
State
:
state
.
State
,
}
return
nil
}
}
}
dipt
.
result
=
&
milvuspb
.
IndexStateResponse
{
Status
:
&
commonpb
.
Status
{
ErrorCode
:
0
,
ErrorCode
:
commonpb
.
ErrorCode_SUCCESS
,
Reason
:
""
,
},
State
:
commonpb
.
IndexState_FINISHED
,
}
return
nil
}
...
...
internal/querynode/flow_graph_gc_node.go
浏览文件 @
b92ff69c
...
...
@@ -21,27 +21,31 @@ func (gcNode *gcNode) Operate(in []*Msg) []*Msg {
// TODO: add error handling
}
gcMsg
,
ok
:=
(
*
in
[
0
])
.
(
*
gcMsg
)
_
,
ok
:=
(
*
in
[
0
])
.
(
*
gcMsg
)
if
!
ok
{
log
.
Println
(
"type assertion failed for gcMsg"
)
// TODO: add error handling
}
// drop collections
for
_
,
collectionID
:=
range
gcMsg
.
gcRecord
.
collections
{
err
:=
gcNode
.
replica
.
removeCollection
(
collectionID
)
if
err
!=
nil
{
log
.
Println
(
err
)
}
}
// Use `releasePartition` and `releaseCollection`,
// because if we drop collections or partitions here, query service doesn't know this behavior,
// which would lead the wrong result of `showCollections` or `showPartition`
// drop partitions
for
_
,
partition
:=
range
gcMsg
.
gcRecord
.
partitions
{
err
:=
gcNode
.
replica
.
removePartition
(
partition
.
collectionID
,
partition
.
partitionID
)
if
err
!=
nil
{
log
.
Println
(
err
)
}
}
//// drop collections
//for _, collectionID := range gcMsg.gcRecord.collections {
// err := gcNode.replica.removeCollection(collectionID)
// if err != nil {
// log.Println(err)
// }
//}
//
//// drop partitions
//for _, partition := range gcMsg.gcRecord.partitions {
// err := gcNode.replica.removePartition(partition.collectionID, partition.partitionID)
// if err != nil {
// log.Println(err)
// }
//}
return
nil
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录