Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
8e0c8feb
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,发现更多精彩内容 >>
未验证
提交
8e0c8feb
编写于
11月 23, 2021
作者:
C
congqixia
提交者:
GitHub
11月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add dropped segment ids in vchaninfo (#12230)
Signed-off-by:
N
Congqi Xia
<
congqi.xia@zilliz.com
>
上级
3fa5b4a9
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
215 addition
and
166 deletion
+215
-166
internal/datacoord/handler.go
internal/datacoord/handler.go
+11
-1
internal/datacoord/server_test.go
internal/datacoord/server_test.go
+29
-0
internal/proto/data_coord.proto
internal/proto/data_coord.proto
+1
-0
internal/proto/datapb/data_coord.pb.go
internal/proto/datapb/data_coord.pb.go
+174
-165
未找到文件。
internal/datacoord/handler.go
浏览文件 @
8e0c8feb
...
...
@@ -28,7 +28,10 @@ func newServerHandler(s *Server) *ServerHandler {
// GetVChanPositions get vchannel latest postitions with provided dml channel names
func
(
h
*
ServerHandler
)
GetVChanPositions
(
channel
string
,
collectionID
UniqueID
,
partitionID
UniqueID
)
*
datapb
.
VchannelInfo
{
segments
:=
h
.
s
.
meta
.
GetSegmentsByChannel
(
channel
)
// cannot use GetSegmentsByChannel since dropped segments are needed here
segments
:=
h
.
s
.
meta
.
SelectSegments
(
func
(
s
*
SegmentInfo
)
bool
{
return
s
.
InsertChannel
==
channel
})
log
.
Debug
(
"GetSegmentsByChannel"
,
zap
.
Any
(
"collectionID"
,
collectionID
),
zap
.
Any
(
"channel"
,
channel
),
...
...
@@ -36,6 +39,7 @@ func (h *ServerHandler) GetVChanPositions(channel string, collectionID UniqueID,
)
var
flushed
[]
*
datapb
.
SegmentInfo
var
unflushed
[]
*
datapb
.
SegmentInfo
var
dropped
[]
UniqueID
var
seekPosition
*
internalpb
.
MsgPosition
for
_
,
s
:=
range
segments
{
if
(
partitionID
>
allPartitionID
&&
s
.
PartitionID
!=
partitionID
)
||
...
...
@@ -43,6 +47,11 @@ func (h *ServerHandler) GetVChanPositions(channel string, collectionID UniqueID,
continue
}
if
s
.
GetState
()
==
commonpb
.
SegmentState_Dropped
{
dropped
=
append
(
dropped
,
s
.
GetID
())
continue
}
if
s
.
GetState
()
==
commonpb
.
SegmentState_Flushing
||
s
.
GetState
()
==
commonpb
.
SegmentState_Flushed
{
flushed
=
append
(
flushed
,
trimSegmentInfo
(
s
.
SegmentInfo
))
}
else
{
...
...
@@ -74,6 +83,7 @@ func (h *ServerHandler) GetVChanPositions(channel string, collectionID UniqueID,
SeekPosition
:
seekPosition
,
FlushedSegments
:
flushed
,
UnflushedSegments
:
unflushed
,
DroppedSegments
:
dropped
,
}
}
...
...
internal/datacoord/server_test.go
浏览文件 @
8e0c8feb
...
...
@@ -1407,6 +1407,35 @@ func TestGetRecoveryInfo(t *testing.T) {
assert
.
ElementsMatch
(
t
,
[]
string
{
"/binlog/file1"
,
"/binlog/file2"
},
resp
.
GetBinlogs
()[
0
]
.
GetFieldBinlogs
()[
0
]
.
GetBinlogs
())
})
t
.
Run
(
"with dropped segments"
,
func
(
t
*
testing
.
T
)
{
svr
:=
newTestServer
(
t
,
nil
)
defer
closeTestServer
(
t
,
svr
)
svr
.
rootCoordClientCreator
=
func
(
ctx
context
.
Context
,
metaRootPath
string
,
etcdEndpoints
[]
string
)
(
types
.
RootCoord
,
error
)
{
return
newMockRootCoordService
(),
nil
}
seg1
:=
createSegment
(
7
,
0
,
0
,
100
,
30
,
"vchan1"
,
commonpb
.
SegmentState_Growing
)
seg2
:=
createSegment
(
8
,
0
,
0
,
100
,
40
,
"vchan1"
,
commonpb
.
SegmentState_Dropped
)
err
:=
svr
.
meta
.
AddSegment
(
NewSegmentInfo
(
seg1
))
assert
.
Nil
(
t
,
err
)
err
=
svr
.
meta
.
AddSegment
(
NewSegmentInfo
(
seg2
))
assert
.
Nil
(
t
,
err
)
req
:=
&
datapb
.
GetRecoveryInfoRequest
{
CollectionID
:
0
,
PartitionID
:
0
,
}
resp
,
err
:=
svr
.
GetRecoveryInfo
(
context
.
TODO
(),
req
)
assert
.
Nil
(
t
,
err
)
assert
.
EqualValues
(
t
,
commonpb
.
ErrorCode_Success
,
resp
.
Status
.
ErrorCode
)
assert
.
EqualValues
(
t
,
0
,
len
(
resp
.
GetBinlogs
()))
assert
.
EqualValues
(
t
,
1
,
len
(
resp
.
GetChannels
()))
assert
.
NotNil
(
t
,
resp
.
GetChannels
()[
0
]
.
SeekPosition
)
assert
.
NotEqual
(
t
,
0
,
resp
.
GetChannels
()[
0
]
.
GetSeekPosition
()
.
GetTimestamp
())
assert
.
ElementsMatch
(
t
,
[]
int64
{
8
},
resp
.
GetChannels
()[
0
]
.
GetDroppedSegments
())
})
t
.
Run
(
"with closed server"
,
func
(
t
*
testing
.
T
)
{
svr
:=
newTestServer
(
t
,
nil
)
closeTestServer
(
t
,
svr
)
...
...
internal/proto/data_coord.proto
浏览文件 @
8e0c8feb
...
...
@@ -167,6 +167,7 @@ message VchannelInfo {
internal.MsgPosition
seek_position
=
3
;
repeated
SegmentInfo
unflushedSegments
=
4
;
repeated
SegmentInfo
flushedSegments
=
5
;
repeated
int64
dropped_segments
=
6
;
}
message
WatchDmChannelsRequest
{
...
...
internal/proto/datapb/data_coord.pb.go
浏览文件 @
8e0c8feb
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录