Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
23baecd7
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 搜索 >>
未验证
提交
23baecd7
编写于
8月 15, 2023
作者:
W
wei liu
提交者:
GitHub
8月 15, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set sealed segment to unreadable before sync target version (#26338)
Signed-off-by:
N
Wei Liu
<
wei.liu@zilliz.com
>
上级
376642b9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
79 addition
and
49 deletion
+79
-49
internal/querynodev2/delegator/delegator_data_test.go
internal/querynodev2/delegator/delegator_data_test.go
+16
-12
internal/querynodev2/delegator/delegator_test.go
internal/querynodev2/delegator/delegator_test.go
+5
-4
internal/querynodev2/delegator/distribution.go
internal/querynodev2/delegator/distribution.go
+6
-0
internal/querynodev2/delegator/distribution_test.go
internal/querynodev2/delegator/distribution_test.go
+52
-33
未找到文件。
internal/querynodev2/delegator/delegator_data_test.go
浏览文件 @
23baecd7
...
...
@@ -377,9 +377,10 @@ func (s *DelegatorDataSuite) TestLoadSegments() {
s
.
Equal
(
int64
(
1
),
sealed
[
0
]
.
NodeID
)
s
.
ElementsMatch
([]
SegmentEntry
{
{
SegmentID
:
100
,
NodeID
:
1
,
PartitionID
:
500
,
SegmentID
:
100
,
NodeID
:
1
,
PartitionID
:
500
,
TargetVersion
:
unreadableTargetVersion
,
},
},
sealed
[
0
]
.
Segments
)
})
...
...
@@ -453,14 +454,16 @@ func (s *DelegatorDataSuite) TestLoadSegments() {
s
.
Equal
(
int64
(
1
),
sealed
[
0
]
.
NodeID
)
s
.
ElementsMatch
([]
SegmentEntry
{
{
SegmentID
:
100
,
NodeID
:
1
,
PartitionID
:
500
,
SegmentID
:
100
,
NodeID
:
1
,
PartitionID
:
500
,
TargetVersion
:
unreadableTargetVersion
,
},
{
SegmentID
:
200
,
NodeID
:
1
,
PartitionID
:
500
,
SegmentID
:
200
,
NodeID
:
1
,
PartitionID
:
500
,
TargetVersion
:
unreadableTargetVersion
,
},
},
sealed
[
0
]
.
Segments
)
})
...
...
@@ -657,9 +660,10 @@ func (s *DelegatorDataSuite) TestReleaseSegment() {
s
.
Equal
(
int64
(
1
),
sealed
[
0
]
.
NodeID
)
s
.
ElementsMatch
([]
SegmentEntry
{
{
SegmentID
:
1000
,
NodeID
:
1
,
PartitionID
:
500
,
SegmentID
:
1000
,
NodeID
:
1
,
PartitionID
:
500
,
TargetVersion
:
unreadableTargetVersion
,
},
},
sealed
[
0
]
.
Segments
)
...
...
internal/querynodev2/delegator/delegator_test.go
浏览文件 @
23baecd7
...
...
@@ -192,10 +192,11 @@ func (s *DelegatorSuite) TestGetSegmentInfo() {
NodeID
:
1
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
1
,
SegmentID
:
1001
,
PartitionID
:
500
,
Version
:
2001
,
NodeID
:
1
,
SegmentID
:
1001
,
PartitionID
:
500
,
Version
:
2001
,
TargetVersion
:
unreadableTargetVersion
,
},
},
},
...
...
internal/querynodev2/delegator/distribution.go
浏览文件 @
23baecd7
...
...
@@ -35,6 +35,9 @@ const (
// for growing segment which not exist in target, and it's start position < max sealed dml position
redundantTargetVersion
=
int64
(
-
1
)
// for sealed segment which loaded by load segment request, should become readable after sync target version
unreadableTargetVersion
=
int64
(
-
2
)
)
var
(
...
...
@@ -186,6 +189,9 @@ func (d *distribution) AddDistributions(entries ...SegmentEntry) {
if
ok
{
// remain the target version for already loaded segment to void skipping this segment when executing search
entry
.
TargetVersion
=
oldEntry
.
TargetVersion
}
else
{
// waiting for sync target version, to become readable
entry
.
TargetVersion
=
unreadableTargetVersion
}
d
.
sealedSegments
[
entry
.
SegmentID
]
=
entry
d
.
offlines
.
Remove
(
entry
.
SegmentID
)
...
...
internal/querynodev2/delegator/distribution_test.go
浏览文件 @
23baecd7
...
...
@@ -64,12 +64,14 @@ func (s *DistributionSuite) TestAddDistribution() {
NodeID
:
1
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
1
,
SegmentID
:
1
,
NodeID
:
1
,
SegmentID
:
1
,
TargetVersion
:
unreadableTargetVersion
,
},
{
NodeID
:
1
,
SegmentID
:
2
,
NodeID
:
1
,
SegmentID
:
2
,
TargetVersion
:
unreadableTargetVersion
,
},
},
},
...
...
@@ -93,8 +95,9 @@ func (s *DistributionSuite) TestAddDistribution() {
NodeID
:
1
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
1
,
SegmentID
:
1
,
NodeID
:
1
,
SegmentID
:
1
,
TargetVersion
:
unreadableTargetVersion
,
},
},
},
...
...
@@ -122,13 +125,15 @@ func (s *DistributionSuite) TestAddDistribution() {
NodeID
:
1
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
1
,
SegmentID
:
1
,
NodeID
:
1
,
SegmentID
:
1
,
TargetVersion
:
unreadableTargetVersion
,
},
{
NodeID
:
1
,
SegmentID
:
3
,
NodeID
:
1
,
SegmentID
:
3
,
TargetVersion
:
unreadableTargetVersion
,
},
},
},
...
...
@@ -136,8 +141,9 @@ func (s *DistributionSuite) TestAddDistribution() {
NodeID
:
2
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
2
,
SegmentID
:
2
,
NodeID
:
2
,
SegmentID
:
2
,
TargetVersion
:
unreadableTargetVersion
,
},
},
},
...
...
@@ -157,8 +163,8 @@ func (s *DistributionSuite) TestAddDistribution() {
{
NodeID
:
1
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
1
,
SegmentID
:
1
},
{
NodeID
:
1
,
SegmentID
:
2
},
{
NodeID
:
1
,
SegmentID
:
1
,
TargetVersion
:
unreadableTargetVersion
},
{
NodeID
:
1
,
SegmentID
:
2
,
TargetVersion
:
unreadableTargetVersion
},
},
},
},
...
...
@@ -287,13 +293,13 @@ func (s *DistributionSuite) TestRemoveDistribution() {
{
NodeID
:
1
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
1
,
SegmentID
:
3
},
{
NodeID
:
1
,
SegmentID
:
3
,
TargetVersion
:
unreadableTargetVersion
},
},
},
{
NodeID
:
2
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
2
,
SegmentID
:
2
},
{
NodeID
:
2
,
SegmentID
:
2
,
TargetVersion
:
unreadableTargetVersion
},
},
},
},
...
...
@@ -322,14 +328,14 @@ func (s *DistributionSuite) TestRemoveDistribution() {
{
NodeID
:
1
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
1
,
SegmentID
:
1
},
{
NodeID
:
1
,
SegmentID
:
3
},
{
NodeID
:
1
,
SegmentID
:
1
,
TargetVersion
:
unreadableTargetVersion
},
{
NodeID
:
1
,
SegmentID
:
3
,
TargetVersion
:
unreadableTargetVersion
},
},
},
{
NodeID
:
2
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
2
,
SegmentID
:
2
},
{
NodeID
:
2
,
SegmentID
:
2
,
TargetVersion
:
unreadableTargetVersion
},
},
},
},
...
...
@@ -358,13 +364,13 @@ func (s *DistributionSuite) TestRemoveDistribution() {
{
NodeID
:
1
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
1
,
SegmentID
:
3
},
{
NodeID
:
1
,
SegmentID
:
3
,
TargetVersion
:
unreadableTargetVersion
},
},
},
{
NodeID
:
2
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
2
,
SegmentID
:
2
},
{
NodeID
:
2
,
SegmentID
:
2
,
TargetVersion
:
unreadableTargetVersion
},
},
},
},
...
...
@@ -395,13 +401,21 @@ func (s *DistributionSuite) TestRemoveDistribution() {
{
NodeID
:
1
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
1
,
SegmentID
:
3
},
{
NodeID
:
1
,
SegmentID
:
3
,
TargetVersion
:
unreadableTargetVersion
,
},
},
},
{
NodeID
:
2
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
2
,
SegmentID
:
2
},
{
NodeID
:
2
,
SegmentID
:
2
,
TargetVersion
:
unreadableTargetVersion
,
},
},
},
},
...
...
@@ -476,12 +490,14 @@ func (s *DistributionSuite) TestPeek() {
NodeID
:
1
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
1
,
SegmentID
:
1
,
NodeID
:
1
,
SegmentID
:
1
,
TargetVersion
:
unreadableTargetVersion
,
},
{
NodeID
:
1
,
SegmentID
:
2
,
NodeID
:
1
,
SegmentID
:
2
,
TargetVersion
:
unreadableTargetVersion
,
},
},
},
...
...
@@ -508,13 +524,15 @@ func (s *DistributionSuite) TestPeek() {
NodeID
:
1
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
1
,
SegmentID
:
1
,
NodeID
:
1
,
SegmentID
:
1
,
TargetVersion
:
unreadableTargetVersion
,
},
{
NodeID
:
1
,
SegmentID
:
3
,
NodeID
:
1
,
SegmentID
:
3
,
TargetVersion
:
unreadableTargetVersion
,
},
},
},
...
...
@@ -522,8 +540,9 @@ func (s *DistributionSuite) TestPeek() {
NodeID
:
2
,
Segments
:
[]
SegmentEntry
{
{
NodeID
:
2
,
SegmentID
:
2
,
NodeID
:
2
,
SegmentID
:
2
,
TargetVersion
:
unreadableTargetVersion
,
},
},
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录