Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
abd250da
M
milvus
项目概览
milvus
/
milvus
10 个月 前同步成功
通知
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 搜索 >>
未验证
提交
abd250da
编写于
5月 23, 2023
作者:
Y
yah01
提交者:
GitHub
5月 23, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix QueryNode is not able to recovery (#24300)
Signed-off-by:
N
yah01
<
yang.cen@zilliz.com
>
上级
7f96dd85
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
354 addition
and
304 deletion
+354
-304
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
+303
-295
internal/querynodev2/services.go
internal/querynodev2/services.go
+28
-0
internal/querynodev2/services_test.go
internal/querynodev2/services_test.go
+22
-9
未找到文件。
internal/proto/query_coord.proto
浏览文件 @
abd250da
...
...
@@ -226,6 +226,7 @@ message WatchDmChannelsRequest {
// for node down load balance, need to remove offline node in time after every watchDmChannel finish.
int64
offlineNodeID
=
11
;
int64
version
=
12
;
repeated
index.IndexInfo
index_info_list
=
13
;
}
message
UnsubDmChannelRequest
{
...
...
internal/proto/querypb/query_coord.pb.go
浏览文件 @
abd250da
此差异已折叠。
点击以展开。
internal/querynodev2/services.go
浏览文件 @
abd250da
...
...
@@ -222,6 +222,32 @@ func (node *QueryNode) WatchDmChannels(ctx context.Context, req *querypb.WatchDm
log
.
Info
(
"channel already subscribed"
)
return
util
.
SuccessStatus
(),
nil
}
fieldIndexMetas
:=
make
([]
*
segcorepb
.
FieldIndexMeta
,
0
)
for
_
,
info
:=
range
req
.
GetIndexInfoList
()
{
fieldIndexMetas
=
append
(
fieldIndexMetas
,
&
segcorepb
.
FieldIndexMeta
{
CollectionID
:
info
.
GetCollectionID
(),
FieldID
:
info
.
GetFieldID
(),
IndexName
:
info
.
GetIndexName
(),
TypeParams
:
info
.
GetTypeParams
(),
IndexParams
:
info
.
GetIndexParams
(),
IsAutoIndex
:
info
.
GetIsAutoIndex
(),
UserIndexParams
:
info
.
GetUserIndexParams
(),
})
}
sizePerRecord
,
err
:=
typeutil
.
EstimateSizePerRecord
(
req
.
Schema
)
maxIndexRecordPerSegment
:=
int64
(
0
)
if
err
!=
nil
||
sizePerRecord
==
0
{
log
.
Warn
(
"failed to transfer segment size to collection, because failed to estimate size per record"
,
zap
.
Error
(
err
))
}
else
{
threshold
:=
paramtable
.
Get
()
.
DataCoordCfg
.
SegmentMaxSize
.
GetAsFloat
()
*
1024
*
1024
proportion
:=
paramtable
.
Get
()
.
DataCoordCfg
.
SegmentSealProportion
.
GetAsFloat
()
maxIndexRecordPerSegment
=
int64
(
threshold
*
proportion
/
float64
(
sizePerRecord
))
}
node
.
manager
.
Collection
.
Put
(
req
.
GetCollectionID
(),
req
.
GetSchema
(),
&
segcorepb
.
CollectionIndexMeta
{
IndexMetas
:
fieldIndexMetas
,
MaxIndexRowCount
:
maxIndexRecordPerSegment
,
},
req
.
GetLoadMeta
())
delegator
,
err
:=
delegator
.
NewShardDelegator
(
req
.
GetCollectionID
(),
req
.
GetReplicaID
(),
channel
.
GetChannelName
(),
req
.
GetVersion
(),
node
.
clusterManager
,
node
.
manager
,
node
.
tSafeManager
,
node
.
loader
,
node
.
factory
,
channel
.
GetSeekPosition
()
.
GetTimestamp
())
if
err
!=
nil
{
...
...
@@ -430,6 +456,8 @@ func (node *QueryNode) LoadSegments(ctx context.Context, req *querypb.LoadSegmen
return
node
.
loadDeltaLogs
(
ctx
,
req
),
nil
}
node
.
manager
.
Collection
.
Put
(
req
.
GetCollectionID
(),
req
.
GetSchema
(),
nil
,
req
.
GetLoadMeta
())
// Delegates request to workers
if
req
.
GetNeedTransfer
()
{
delegator
,
ok
:=
node
.
delegators
.
Get
(
segment
.
GetInsertChannel
())
...
...
internal/querynodev2/services_test.go
浏览文件 @
abd250da
...
...
@@ -53,6 +53,7 @@ type ServiceSuite struct {
msgChan
chan
*
msgstream
.
MsgPack
collectionID
int64
collectionName
string
schema
*
schemapb
.
CollectionSchema
partitionIDs
[]
int64
// Test segments
validSegmentIDs
[]
int64
...
...
@@ -124,15 +125,6 @@ func (suite *ServiceSuite) SetupTest() {
// start node
err
=
suite
.
node
.
Start
()
suite
.
NoError
(
err
)
// init collection
schema
:=
segments
.
GenTestCollectionSchema
(
suite
.
collectionName
,
schemapb
.
DataType_Int64
)
LoadMeta
:=
&
querypb
.
LoadMetaInfo
{
LoadType
:
querypb
.
LoadType_LoadCollection
,
CollectionID
:
suite
.
collectionID
,
PartitionIDs
:
suite
.
partitionIDs
,
}
suite
.
node
.
manager
.
Collection
.
Put
(
suite
.
collectionID
,
schema
,
nil
,
LoadMeta
)
}
func
(
suite
*
ServiceSuite
)
TearDownTest
()
{
...
...
@@ -250,6 +242,12 @@ func (suite *ServiceSuite) TestWatchDmChannelsInt64() {
DroppedSegmentIds
:
suite
.
droppedSegmentIDs
,
},
},
Schema
:
segments
.
GenTestCollectionSchema
(
suite
.
collectionName
,
schemapb
.
DataType_Int64
),
LoadMeta
:
&
querypb
.
LoadMetaInfo
{
LoadType
:
querypb
.
LoadType_LoadCollection
,
CollectionID
:
suite
.
collectionID
,
PartitionIDs
:
suite
.
partitionIDs
,
},
}
// mocks
...
...
@@ -292,6 +290,12 @@ func (suite *ServiceSuite) TestWatchDmChannelsVarchar() {
DroppedSegmentIds
:
suite
.
droppedSegmentIDs
,
},
},
Schema
:
segments
.
GenTestCollectionSchema
(
suite
.
collectionName
,
schemapb
.
DataType_VarChar
),
LoadMeta
:
&
querypb
.
LoadMetaInfo
{
LoadType
:
querypb
.
LoadType_LoadCollection
,
CollectionID
:
suite
.
collectionID
,
PartitionIDs
:
suite
.
partitionIDs
,
},
}
// mocks
...
...
@@ -334,6 +338,7 @@ func (suite *ServiceSuite) TestWatchDmChannels_Failed() {
DroppedSegmentIds
:
suite
.
droppedSegmentIDs
,
},
},
Schema
:
segments
.
GenTestCollectionSchema
(
suite
.
collectionName
,
schemapb
.
DataType_Int64
),
}
// init msgstream failed
...
...
@@ -470,6 +475,7 @@ func (suite *ServiceSuite) TestLoadSegments_Int64() {
CollectionID
:
suite
.
collectionID
,
DstNodeID
:
suite
.
node
.
session
.
ServerID
,
Infos
:
suite
.
genSegmentLoadInfos
(
schema
),
Schema
:
schema
,
DeltaPositions
:
[]
*
msgpb
.
MsgPosition
{{
Timestamp
:
20000
}},
NeedTransfer
:
true
,
}
...
...
@@ -500,6 +506,7 @@ func (suite *ServiceSuite) TestLoadSegments_VarChar() {
CollectionID
:
suite
.
collectionID
,
DstNodeID
:
suite
.
node
.
session
.
ServerID
,
Infos
:
suite
.
genSegmentLoadInfos
(
schema
),
Schema
:
schema
,
DeltaPositions
:
[]
*
msgpb
.
MsgPosition
{{
Timestamp
:
20000
}},
NeedTransfer
:
true
,
}
...
...
@@ -523,6 +530,7 @@ func (suite *ServiceSuite) TestLoadDeltaInt64() {
CollectionID
:
suite
.
collectionID
,
DstNodeID
:
suite
.
node
.
session
.
ServerID
,
Infos
:
suite
.
genSegmentLoadInfos
(
schema
),
Schema
:
schema
,
NeedTransfer
:
true
,
LoadScope
:
querypb
.
LoadScope_Delta
,
}
...
...
@@ -546,6 +554,7 @@ func (suite *ServiceSuite) TestLoadDeltaVarchar() {
CollectionID
:
suite
.
collectionID
,
DstNodeID
:
suite
.
node
.
session
.
ServerID
,
Infos
:
suite
.
genSegmentLoadInfos
(
schema
),
Schema
:
schema
,
NeedTransfer
:
true
,
LoadScope
:
querypb
.
LoadScope_Delta
,
}
...
...
@@ -568,6 +577,7 @@ func (suite *ServiceSuite) TestLoadSegments_Failed() {
CollectionID
:
suite
.
collectionID
,
DstNodeID
:
suite
.
node
.
session
.
ServerID
,
Infos
:
suite
.
genSegmentLoadInfos
(
schema
),
Schema
:
schema
,
NeedTransfer
:
true
,
}
...
...
@@ -609,6 +619,7 @@ func (suite *ServiceSuite) TestLoadSegments_Transfer() {
CollectionID
:
suite
.
collectionID
,
DstNodeID
:
suite
.
node
.
session
.
ServerID
,
Infos
:
suite
.
genSegmentLoadInfos
(
schema
),
Schema
:
schema
,
NeedTransfer
:
true
,
}
...
...
@@ -629,6 +640,7 @@ func (suite *ServiceSuite) TestLoadSegments_Transfer() {
CollectionID
:
suite
.
collectionID
,
DstNodeID
:
suite
.
node
.
session
.
ServerID
,
Infos
:
suite
.
genSegmentLoadInfos
(
schema
),
Schema
:
schema
,
NeedTransfer
:
true
,
}
...
...
@@ -654,6 +666,7 @@ func (suite *ServiceSuite) TestLoadSegments_Transfer() {
CollectionID
:
suite
.
collectionID
,
DstNodeID
:
suite
.
node
.
session
.
ServerID
,
Infos
:
suite
.
genSegmentLoadInfos
(
schema
),
Schema
:
schema
,
NeedTransfer
:
true
,
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录