Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
11834a09
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,发现更多精彩内容 >>
未验证
提交
11834a09
编写于
5月 30, 2022
作者:
B
bigsheeper
提交者:
GitHub
5月 30, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve query log in QueryNode (#17268)
Signed-off-by:
N
bigsheeper
<
yihao.dai@zilliz.com
>
上级
b0d54ed0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
24 deletion
+33
-24
internal/querynode/impl.go
internal/querynode/impl.go
+13
-2
internal/querynode/query_shard.go
internal/querynode/query_shard.go
+1
-9
internal/querynode/query_shard_test.go
internal/querynode/query_shard_test.go
+2
-2
internal/querynode/task_read.go
internal/querynode/task_read.go
+17
-11
未找到文件。
internal/querynode/impl.go
浏览文件 @
11834a09
...
...
@@ -579,7 +579,12 @@ func (node *QueryNode) Search(ctx context.Context, req *queryPb.SearchRequest) (
return
failRet
,
nil
}
log
.
Debug
(
"Received SearchRequest"
,
zap
.
String
(
"vchannel"
,
req
.
GetDmlChannel
()),
zap
.
Int64s
(
"segmentIDs"
,
req
.
GetSegmentIDs
()))
log
.
Debug
(
"Received SearchRequest"
,
zap
.
Int64
(
"msgID"
,
req
.
GetReq
()
.
GetBase
()
.
GetMsgID
()),
zap
.
String
(
"vChannel"
,
req
.
GetDmlChannel
()),
zap
.
Int64s
(
"segmentIDs"
,
req
.
GetSegmentIDs
()),
zap
.
Uint64
(
"guaranteeTimestamp"
,
req
.
GetReq
()
.
GetGuaranteeTimestamp
()),
zap
.
Uint64
(
"timeTravel"
,
req
.
GetReq
()
.
GetTravelTimestamp
()))
if
node
.
queryShardService
==
nil
{
failRet
.
Status
.
Reason
=
"queryShardService is nil"
...
...
@@ -739,7 +744,13 @@ func (node *QueryNode) Query(ctx context.Context, req *queryPb.QueryRequest) (*i
failRet
.
Status
.
Reason
=
msgQueryNodeIsUnhealthy
(
Params
.
QueryNodeCfg
.
GetNodeID
())
return
failRet
,
nil
}
log
.
Debug
(
"Received QueryRequest"
,
zap
.
String
(
"vchannel"
,
req
.
GetDmlChannel
()),
zap
.
Int64s
(
"segmentIDs"
,
req
.
GetSegmentIDs
()))
log
.
Debug
(
"Received QueryRequest"
,
zap
.
Int64
(
"msgID"
,
req
.
GetReq
()
.
GetBase
()
.
GetMsgID
()),
zap
.
String
(
"vChannel"
,
req
.
GetDmlChannel
()),
zap
.
Int64s
(
"segmentIDs"
,
req
.
GetSegmentIDs
()),
zap
.
Uint64
(
"guaranteeTimestamp"
,
req
.
GetReq
()
.
GetGuaranteeTimestamp
()),
zap
.
Uint64
(
"timeTravel"
,
req
.
GetReq
()
.
GetTravelTimestamp
()))
if
node
.
queryShardService
==
nil
{
failRet
.
Status
.
Reason
=
"queryShardService is nil"
...
...
internal/querynode/query_shard.go
浏览文件 @
11834a09
...
...
@@ -127,15 +127,7 @@ func (tp tsType) String() string {
return
""
}
func
(
q
*
queryShard
)
getServiceableTime
(
tp
tsType
)
(
Timestamp
,
error
)
{
var
channel
string
switch
tp
{
case
tsTypeDML
:
channel
=
q
.
channel
case
tsTypeDelta
:
channel
=
q
.
deltaChannel
}
func
(
q
*
queryShard
)
getServiceableTime
(
channel
Channel
)
(
Timestamp
,
error
)
{
ts
,
err
:=
q
.
tSafeReplica
.
getTSafe
(
channel
)
if
err
!=
nil
{
return
0
,
err
...
...
internal/querynode/query_shard_test.go
浏览文件 @
11834a09
...
...
@@ -127,11 +127,11 @@ func TestQueryShard_getServiceableTime(t *testing.T) {
err
=
updateQueryShardTSafe
(
qs
,
timestamp
)
assert
.
NoError
(
t
,
err
)
dmlTimestamp
,
err
:=
qs
.
getServiceableTime
(
tsTypeDML
)
dmlTimestamp
,
err
:=
qs
.
getServiceableTime
(
qs
.
channel
)
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
timestamp
,
dmlTimestamp
)
deltaTimestamp
,
err
:=
qs
.
getServiceableTime
(
tsTypeDelta
)
deltaTimestamp
,
err
:=
qs
.
getServiceableTime
(
qs
.
deltaChannel
)
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
timestamp
,
deltaTimestamp
)
}
...
...
internal/querynode/task_read.go
浏览文件 @
11834a09
...
...
@@ -139,15 +139,13 @@ func (b *baseReadTask) Ready() (bool, error) {
if
b
.
Timeout
()
{
return
false
,
fmt
.
Errorf
(
"deadline exceed"
)
}
var
err
error
var
tType
tsType
var
channel
Channel
if
b
.
DataScope
==
querypb
.
DataScope_Streaming
{
tType
=
tsTypeDML
channel
=
b
.
QS
.
channel
}
else
if
b
.
DataScope
==
querypb
.
DataScope_Historical
{
tType
=
tsTypeDelta
}
if
err
!=
nil
{
return
false
,
err
channel
=
b
.
QS
.
deltaChannel
}
else
{
return
false
,
fmt
.
Errorf
(
"unexpected dataScope %s"
,
b
.
DataScope
.
String
())
}
if
_
,
released
:=
b
.
QS
.
collection
.
getReleaseTime
();
released
{
...
...
@@ -155,9 +153,9 @@ func (b *baseReadTask) Ready() (bool, error) {
return
false
,
fmt
.
Errorf
(
"collection has been released, taskID = %d, collectionID = %d"
,
b
.
ID
(),
b
.
CollectionID
)
}
serviceTime
,
err
2
:=
b
.
QS
.
getServiceableTime
(
tType
)
if
err
2
!=
nil
{
return
false
,
fmt
.
Errorf
(
"failed to get service timestamp, taskID = %d, collectionID = %d, err=%w"
,
b
.
ID
(),
b
.
CollectionID
,
err
2
)
serviceTime
,
err
:=
b
.
QS
.
getServiceableTime
(
channel
)
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"failed to get service timestamp, taskID = %d, collectionID = %d, err=%w"
,
b
.
ID
(),
b
.
CollectionID
,
err
)
}
guaranteeTs
:=
b
.
GuaranteeTimestamp
gt
,
_
:=
tsoutil
.
ParseTS
(
guaranteeTs
)
...
...
@@ -167,9 +165,17 @@ func (b *baseReadTask) Ready() (bool, error) {
zap
.
Any
(
"collectionID"
,
b
.
CollectionID
),
zap
.
Any
(
"sm.GuaranteeTimestamp"
,
gt
),
zap
.
Any
(
"serviceTime"
,
st
),
zap
.
Any
(
"delta seconds"
,
(
guaranteeTs
-
serviceTime
)
/
(
1000
*
1000
*
1000
)),
zap
.
Any
(
"delta milliseconds"
,
gt
.
Sub
(
st
)
.
Milliseconds
()),
zap
.
Any
(
"channel"
,
channel
),
zap
.
Any
(
"msgID"
,
b
.
ID
()))
return
false
,
nil
}
log
.
Debug
(
"query msg can do"
,
zap
.
Any
(
"collectionID"
,
b
.
CollectionID
),
zap
.
Any
(
"sm.GuaranteeTimestamp"
,
gt
),
zap
.
Any
(
"serviceTime"
,
st
),
zap
.
Any
(
"delta milliseconds"
,
gt
.
Sub
(
st
)
.
Milliseconds
()),
zap
.
Any
(
"channel"
,
channel
),
zap
.
Any
(
"msgID"
,
b
.
ID
()))
return
true
,
nil
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录