Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
c019e80d
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,发现更多精彩内容 >>
未验证
提交
c019e80d
编写于
10月 28, 2021
作者:
C
congqixia
提交者:
GitHub
10月 28, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change SeekPosition to earliest of all segments (#10771)
Signed-off-by:
N
Congqi Xia
<
congqi.xia@zilliz.com
>
上级
4186e785
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
14 deletion
+16
-14
internal/datacoord/channel_manager.go
internal/datacoord/channel_manager.go
+1
-1
internal/datacoord/server.go
internal/datacoord/server.go
+11
-10
internal/datacoord/server_test.go
internal/datacoord/server_test.go
+3
-2
internal/datacoord/services.go
internal/datacoord/services.go
+1
-1
未找到文件。
internal/datacoord/channel_manager.go
浏览文件 @
c019e80d
...
...
@@ -250,7 +250,7 @@ func (c *ChannelManager) Watch(ch *channel) error {
func
(
c
*
ChannelManager
)
fillChannelPosition
(
update
*
ChannelOp
)
{
for
_
,
ch
:=
range
update
.
Channels
{
vchan
:=
c
.
posProvider
.
GetVChanPositions
(
ch
.
Name
,
ch
.
CollectionID
,
tru
e
)
vchan
:=
c
.
posProvider
.
GetVChanPositions
(
ch
.
Name
,
ch
.
CollectionID
,
fals
e
)
info
:=
&
datapb
.
ChannelWatchInfo
{
Vchan
:
vchan
,
StartTs
:
time
.
Now
()
.
Unix
(),
...
...
internal/datacoord/server.go
浏览文件 @
c019e80d
...
...
@@ -683,29 +683,30 @@ func (s *Server) GetVChanPositions(channel string, collectionID UniqueID, seekFr
flushed
:=
make
([]
*
datapb
.
SegmentInfo
,
0
)
unflushed
:=
make
([]
*
datapb
.
SegmentInfo
,
0
)
var
seekPosition
*
internalpb
.
MsgPosition
var
useUnflushedPosition
bool
for
_
,
s
:=
range
segments
{
if
s
.
State
==
commonpb
.
SegmentState_Flushing
||
s
.
State
==
commonpb
.
SegmentState_Flushed
{
flushed
=
append
(
flushed
,
trimSegmentInfo
(
s
.
SegmentInfo
))
if
seekPosition
==
nil
||
(
!
useUnflushedPosition
&&
s
.
DmlPosition
.
Timestamp
>
seekPosition
.
Timestamp
)
{
if
seekPosition
==
nil
||
(
s
.
DmlPosition
.
Timestamp
<
seekPosition
.
Timestamp
)
{
seekPosition
=
s
.
DmlPosition
}
continue
}
if
s
.
DmlPosition
==
nil
{
if
s
.
DmlPosition
==
nil
{
// segment position all nil
continue
}
unflushed
=
append
(
unflushed
,
trimSegmentInfo
(
s
.
SegmentInfo
))
if
seekPosition
==
nil
||
!
useUnflushedPosition
||
s
.
DmlPosition
.
Timestamp
<
seekPosition
.
Timestamp
{
useUnflushedPosition
=
true
if
!
seekFromStartPosition
{
seekPosition
=
s
.
DmlPosition
}
else
{
seekPosition
=
s
.
StartPosition
}
segmentPosition
:=
s
.
DmlPosition
if
seekFromStartPosition
{
// need to use start position when load collection/partition, querynode does not support seek from checkpoint yet
// TODO silverxia remove seek from start logic after checkpoint supported in querynode
segmentPosition
=
s
.
StartPosition
}
if
seekPosition
==
nil
||
segmentPosition
.
Timestamp
<
seekPosition
.
Timestamp
{
seekPosition
=
segmentPosition
}
}
// use collection start position when segment position is not found
...
...
internal/datacoord/server_test.go
浏览文件 @
c019e80d
...
...
@@ -1179,7 +1179,7 @@ func TestGetRecoveryInfo(t *testing.T) {
}
}
t
.
Run
(
"test get
larg
est position of flushed segments as seek position"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"test get
earli
est position of flushed segments as seek position"
,
func
(
t
*
testing
.
T
)
{
svr
:=
newTestServer
(
t
,
nil
)
defer
closeTestServer
(
t
,
svr
)
...
...
@@ -1204,7 +1204,7 @@ func TestGetRecoveryInfo(t *testing.T) {
assert
.
EqualValues
(
t
,
1
,
len
(
resp
.
GetChannels
()))
assert
.
EqualValues
(
t
,
0
,
len
(
resp
.
GetChannels
()[
0
]
.
GetUnflushedSegments
()))
assert
.
ElementsMatch
(
t
,
[]
*
datapb
.
SegmentInfo
{
trimSegmentInfo
(
seg1
),
trimSegmentInfo
(
seg2
)},
resp
.
GetChannels
()[
0
]
.
GetFlushedSegments
())
assert
.
EqualValues
(
t
,
2
0
,
resp
.
GetChannels
()[
0
]
.
GetSeekPosition
()
.
GetTimestamp
())
assert
.
EqualValues
(
t
,
1
0
,
resp
.
GetChannels
()[
0
]
.
GetSeekPosition
()
.
GetTimestamp
())
})
t
.
Run
(
"test get recovery of unflushed segments "
,
func
(
t
*
testing
.
T
)
{
...
...
@@ -1232,6 +1232,7 @@ func TestGetRecoveryInfo(t *testing.T) {
assert
.
EqualValues
(
t
,
0
,
len
(
resp
.
GetBinlogs
()))
assert
.
EqualValues
(
t
,
1
,
len
(
resp
.
GetChannels
()))
assert
.
NotNil
(
t
,
resp
.
GetChannels
()[
0
]
.
SeekPosition
)
assert
.
EqualValues
(
t
,
0
,
resp
.
GetChannels
()[
0
]
.
GetSeekPosition
()
.
GetTimestamp
())
})
t
.
Run
(
"test get binlogs"
,
func
(
t
*
testing
.
T
)
{
...
...
internal/datacoord/services.go
浏览文件 @
c019e80d
...
...
@@ -476,7 +476,7 @@ func (s *Server) GetRecoveryInfo(ctx context.Context, req *datapb.GetRecoveryInf
channels
:=
dresp
.
GetVirtualChannelNames
()
channelInfos
:=
make
([]
*
datapb
.
VchannelInfo
,
0
,
len
(
channels
))
for
_
,
c
:=
range
channels
{
channelInfo
:=
s
.
GetVChanPositions
(
c
,
collectionID
,
fals
e
)
channelInfo
:=
s
.
GetVChanPositions
(
c
,
collectionID
,
tru
e
)
channelInfos
=
append
(
channelInfos
,
channelInfo
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录