Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
675821c7
M
milvus
项目概览
milvus
/
milvus
9 个月 前同步成功
通知
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 搜索 >>
未验证
提交
675821c7
编写于
5月 22, 2023
作者:
M
MrPresent-Han
提交者:
GitHub
5月 22, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine log and process for distribution handler (#24239)
Signed-off-by:
N
MrPresent-Han
<
chun.han@zilliz.com
>
上级
6da88537
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
10 deletion
+22
-10
internal/querycoordv2/balance/utils.go
internal/querycoordv2/balance/utils.go
+2
-0
internal/querycoordv2/dist/dist_controller.go
internal/querycoordv2/dist/dist_controller.go
+6
-1
internal/querycoordv2/dist/dist_handler.go
internal/querycoordv2/dist/dist_handler.go
+14
-9
未找到文件。
internal/querycoordv2/balance/utils.go
浏览文件 @
675821c7
...
...
@@ -56,6 +56,7 @@ func CreateSegmentTasksFromPlans(ctx context.Context, checkerID int64, timeout t
if
err
!=
nil
{
log
.
Warn
(
"create segment task from plan failed"
,
zap
.
Int64
(
"collection"
,
p
.
Segment
.
GetCollectionID
()),
zap
.
Int64
(
"segmentID"
,
p
.
Segment
.
GetID
()),
zap
.
Int64
(
"replica"
,
p
.
ReplicaID
),
zap
.
String
(
"channel"
,
p
.
Segment
.
GetInsertChannel
()),
zap
.
Int64
(
"from"
,
p
.
From
),
...
...
@@ -67,6 +68,7 @@ func CreateSegmentTasksFromPlans(ctx context.Context, checkerID int64, timeout t
log
.
Info
(
"create segment task"
,
zap
.
Int64
(
"collection"
,
p
.
Segment
.
GetCollectionID
()),
zap
.
Int64
(
"segmentID"
,
p
.
Segment
.
GetID
()),
zap
.
Int64
(
"replica"
,
p
.
ReplicaID
),
zap
.
String
(
"channel"
,
p
.
Segment
.
GetInsertChannel
()),
zap
.
Int64
(
"from"
,
p
.
From
),
...
...
internal/querycoordv2/dist/dist_controller.go
浏览文件 @
675821c7
...
...
@@ -74,7 +74,12 @@ func (dc *ControllerImpl) SyncAll(ctx context.Context) {
wg
.
Add
(
1
)
go
func
(
handler
*
distHandler
)
{
defer
wg
.
Done
()
handler
.
getDistribution
(
ctx
)
resp
,
err
:=
handler
.
getDistribution
(
ctx
)
if
err
!=
nil
{
log
.
Error
(
"SyncAll come across err when getting data distribution"
,
zap
.
Error
(
err
))
}
else
{
handler
.
handleDistResp
(
resp
)
}
}(
h
)
}
wg
.
Wait
()
...
...
internal/querycoordv2/dist/dist_handler.go
浏览文件 @
675821c7
...
...
@@ -38,8 +38,9 @@ import (
)
const
(
distReqTimeout
=
3
*
time
.
Second
maxFailureTimes
=
3
distReqTimeout
=
3
*
time
.
Second
heartBeatLagBehindWarn
=
3
*
time
.
Second
maxFailureTimes
=
3
)
type
distHandler
struct
{
...
...
@@ -71,16 +72,18 @@ func (dh *distHandler) start(ctx context.Context) {
log
.
Info
(
"close dist handler"
)
return
case
<-
ticker
.
C
:
err
:=
dh
.
getDistribution
(
ctx
)
resp
,
err
:=
dh
.
getDistribution
(
ctx
)
if
err
!=
nil
{
node
:=
dh
.
nodeManager
.
Get
(
dh
.
nodeID
)
fields
:=
[]
zap
.
Field
{
zap
.
Int
(
"times"
,
failures
)}
if
node
!=
nil
{
fields
=
append
(
fields
,
zap
.
Time
(
"lastHeartbeat"
,
node
.
LastHeartbeat
()))
}
fields
=
append
(
fields
,
zap
.
Error
(
err
))
log
.
RatedWarn
(
30.0
,
"failed to get data distribution"
,
fields
...
)
}
else
{
failures
=
0
dh
.
handleDistResp
(
resp
)
}
}
}
...
...
@@ -93,6 +96,10 @@ func (dh *distHandler) handleDistResp(resp *querypb.GetDataDistributionResponse)
session
.
WithSegmentCnt
(
len
(
resp
.
GetSegments
())),
session
.
WithChannelCnt
(
len
(
resp
.
GetChannels
())),
)
if
time
.
Since
(
node
.
LastHeartbeat
())
>
heartBeatLagBehindWarn
{
log
.
Warn
(
"node last heart beat time lag too behind"
,
zap
.
Time
(
"now"
,
time
.
Now
()),
zap
.
Time
(
"lastHeartBeatTime"
,
node
.
LastHeartbeat
()),
zap
.
Int64
(
"nodeID"
,
node
.
ID
()))
}
node
.
SetLastHeartbeat
(
time
.
Now
())
}
...
...
@@ -201,7 +208,7 @@ func (dh *distHandler) updateLeaderView(resp *querypb.GetDataDistributionRespons
dh
.
dist
.
LeaderViewManager
.
Update
(
resp
.
GetNodeID
(),
updates
...
)
}
func
(
dh
*
distHandler
)
getDistribution
(
ctx
context
.
Context
)
error
{
func
(
dh
*
distHandler
)
getDistribution
(
ctx
context
.
Context
)
(
*
querypb
.
GetDataDistributionResponse
,
error
)
{
dh
.
mu
.
Lock
()
defer
dh
.
mu
.
Unlock
()
...
...
@@ -225,14 +232,12 @@ func (dh *distHandler) getDistribution(ctx context.Context) error {
})
if
err
!=
nil
{
return
err
return
nil
,
err
}
if
!
merr
.
Ok
(
resp
.
GetStatus
())
{
return
merr
.
Error
(
resp
.
GetStatus
())
return
nil
,
merr
.
Error
(
resp
.
GetStatus
())
}
dh
.
handleDistResp
(
resp
)
return
nil
return
resp
,
nil
}
func
(
dh
*
distHandler
)
stop
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录