Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
b75dcf90
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,发现更多精彩内容 >>
未验证
提交
b75dcf90
编写于
6月 20, 2023
作者:
J
jaime
提交者:
GitHub
6月 20, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix Flush hang after SyncSegments timeout (#24953)
Signed-off-by:
N
jaime
<
yun.zhang@zilliz.com
>
上级
af1d84e5
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
13 addition
and
11 deletion
+13
-11
internal/datanode/compaction_executor.go
internal/datanode/compaction_executor.go
+4
-3
internal/datanode/compaction_executor_test.go
internal/datanode/compaction_executor_test.go
+1
-1
internal/datanode/compactor.go
internal/datanode/compactor.go
+4
-4
internal/datanode/compactor_test.go
internal/datanode/compactor_test.go
+2
-2
internal/datanode/services.go
internal/datanode/services.go
+2
-1
未找到文件。
internal/datanode/compaction_executor.go
浏览文件 @
b75dcf90
...
...
@@ -58,11 +58,12 @@ func (c *compactionExecutor) toCompleteState(task compactor) {
task
.
complete
()
c
.
executing
.
Delete
(
task
.
getPlanID
())
}
func
(
c
*
compactionExecutor
)
injectDone
(
planID
UniqueID
)
{
func
(
c
*
compactionExecutor
)
injectDone
(
planID
UniqueID
,
success
bool
)
{
c
.
completed
.
Delete
(
planID
)
task
,
loaded
:=
c
.
completedCompactor
.
LoadAndDelete
(
planID
)
if
loaded
{
task
.
(
compactor
)
.
injectDone
()
task
.
(
compactor
)
.
injectDone
(
success
)
}
}
...
...
@@ -128,7 +129,7 @@ func (c *compactionExecutor) stopExecutingtaskByVChannelName(vChannelName string
// remove all completed plans for vChannelName
c
.
completed
.
Range
(
func
(
key
interface
{},
value
interface
{})
bool
{
if
value
.
(
*
datapb
.
CompactionResult
)
.
GetChannel
()
==
vChannelName
{
c
.
injectDone
(
key
.
(
UniqueID
))
c
.
injectDone
(
key
.
(
UniqueID
)
,
true
)
log
.
Info
(
"remove compaction results for dropped channel"
,
zap
.
String
(
"channel"
,
vChannelName
),
zap
.
Int64
(
"planID"
,
key
.
(
UniqueID
)))
...
...
internal/datanode/compaction_executor_test.go
浏览文件 @
b75dcf90
...
...
@@ -142,7 +142,7 @@ func (mc *mockCompactor) complete() {
mc
.
done
<-
struct
{}{}
}
func
(
mc
*
mockCompactor
)
injectDone
()
{
func
(
mc
*
mockCompactor
)
injectDone
(
success
bool
)
{
}
...
...
internal/datanode/compactor.go
浏览文件 @
b75dcf90
...
...
@@ -60,7 +60,7 @@ type iterator = storage.Iterator
type
compactor
interface
{
complete
()
compact
()
(
*
datapb
.
CompactionResult
,
error
)
injectDone
()
injectDone
(
success
bool
)
stop
()
getPlanID
()
UniqueID
getCollection
()
UniqueID
...
...
@@ -126,7 +126,7 @@ func (t *compactionTask) complete() {
func
(
t
*
compactionTask
)
stop
()
{
t
.
cancel
()
<-
t
.
done
t
.
injectDone
()
t
.
injectDone
(
true
)
}
func
(
t
*
compactionTask
)
getPlanID
()
UniqueID
{
...
...
@@ -759,10 +759,10 @@ func (t *compactionTask) compact() (*datapb.CompactionResult, error) {
return
pack
,
nil
}
func
(
t
*
compactionTask
)
injectDone
()
{
func
(
t
*
compactionTask
)
injectDone
(
success
bool
)
{
if
t
.
inject
!=
nil
{
uninjectStart
:=
time
.
Now
()
t
.
inject
.
injectDone
(
true
)
t
.
inject
.
injectDone
(
success
)
uninjectEnd
:=
time
.
Now
()
log
.
Info
(
"uninject elapse in ms"
,
zap
.
Int64
(
"planID"
,
t
.
plan
.
GetPlanID
()),
zap
.
Float64
(
"elapse"
,
nano2Milli
(
uninjectEnd
.
Sub
(
uninjectStart
))))
}
...
...
internal/datanode/compactor_test.go
浏览文件 @
b75dcf90
...
...
@@ -863,7 +863,7 @@ func TestCompactorInterfaceMethods(t *testing.T) {
assert
.
NotEmpty
(
t
,
result
.
Field2StatslogPaths
)
assert
.
Equal
(
t
,
0
,
mockfm
.
injectCount
())
task
.
injectDone
()
task
.
injectDone
(
true
)
time
.
Sleep
(
500
*
time
.
Millisecond
)
assert
.
Equal
(
t
,
1
,
mockfm
.
injectCount
())
}
...
...
@@ -958,7 +958,7 @@ func TestCompactorInterfaceMethods(t *testing.T) {
assert
.
NotEmpty
(
t
,
result
.
Field2StatslogPaths
)
assert
.
Equal
(
t
,
0
,
mockfm
.
injectCount
())
task
.
injectDone
()
task
.
injectDone
(
true
)
time
.
Sleep
(
500
*
time
.
Millisecond
)
assert
.
Equal
(
t
,
1
,
mockfm
.
injectCount
())
})
...
...
internal/datanode/services.go
浏览文件 @
b75dcf90
...
...
@@ -399,9 +399,10 @@ func (node *DataNode) SyncSegments(ctx context.Context, req *datapb.SyncSegments
ds
.
fg
.
Blockall
()
defer
ds
.
fg
.
Unblock
()
if
err
:=
channel
.
mergeFlushedSegments
(
ctx
,
targetSeg
,
req
.
GetPlanID
(),
req
.
GetCompactedFrom
());
err
!=
nil
{
node
.
compactionExecutor
.
injectDone
(
req
.
GetPlanID
(),
false
)
return
merr
.
Status
(
err
),
nil
}
node
.
compactionExecutor
.
injectDone
(
req
.
GetPlanID
())
node
.
compactionExecutor
.
injectDone
(
req
.
GetPlanID
()
,
true
)
return
merr
.
Status
(
nil
),
nil
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录