Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
f57fe6d7
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
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 搜索 >>
未验证
提交
f57fe6d7
编写于
6月 19, 2023
作者:
X
Xiaofan
提交者:
GitHub
6月 19, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add compaction log (#24976)
Signed-off-by:
N
xiaofan-luan
<
xiaofan.luan@zilliz.com
>
上级
d143682d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
12 deletion
+16
-12
internal/datacoord/compaction.go
internal/datacoord/compaction.go
+4
-1
internal/datanode/binlog_io.go
internal/datanode/binlog_io.go
+2
-1
internal/datanode/compaction_executor.go
internal/datanode/compaction_executor.go
+1
-1
internal/datanode/compactor.go
internal/datanode/compactor.go
+9
-9
未找到文件。
internal/datacoord/compaction.go
浏览文件 @
f57fe6d7
...
...
@@ -312,7 +312,10 @@ func (c *compactionPlanHandler) updateCompaction(ts Timestamp) error {
if
ok
{
if
state
==
commonpb
.
CompactionState_Completed
{
log
.
Info
(
"compaction completed"
,
zap
.
Int64
(
"planID"
,
planID
),
zap
.
Int64
(
"nodeID"
,
task
.
dataNodeID
))
c
.
completeCompaction
(
stateResult
.
GetResult
())
err
:=
c
.
completeCompaction
(
stateResult
.
GetResult
())
if
err
!=
nil
{
log
.
Warn
(
"fail to complete compaction"
,
zap
.
Int64
(
"planID"
,
planID
),
zap
.
Int64
(
"nodeID"
,
task
.
dataNodeID
),
zap
.
Error
(
err
))
}
continue
}
// check wether the CompactionPlan is timeout
...
...
internal/datanode/binlog_io.go
浏览文件 @
f57fe6d7
...
...
@@ -73,12 +73,13 @@ func (b *binlogIO) download(ctx context.Context, paths []string) ([]*Blob, error
vs
[][]
byte
)
log
.
Debug
(
"down load"
,
zap
.
Strings
(
"path"
,
paths
))
g
,
gCtx
:=
errgroup
.
WithContext
(
ctx
)
g
.
Go
(
func
()
error
{
for
err
!=
nil
{
select
{
case
<-
gCtx
.
Done
()
:
log
.
Warn
(
"ctx done when downloading kvs from blob storage"
)
log
.
Warn
(
"ctx done when downloading kvs from blob storage"
,
zap
.
Strings
(
"paths"
,
paths
)
)
return
errDownloadFromBlobStorage
default
:
...
...
internal/datanode/compaction_executor.go
浏览文件 @
f57fe6d7
...
...
@@ -87,7 +87,7 @@ func (c *compactionExecutor) executeTask(task compactor) {
c
.
toCompleteState
(
task
)
}()
log
.
Info
(
"start to execute compaction"
,
zap
.
Int64
(
"planID"
,
task
.
getPlanID
()))
log
.
Info
(
"start to execute compaction"
,
zap
.
Int64
(
"planID"
,
task
.
getPlanID
())
,
zap
.
Int64
(
"Collection"
,
task
.
getCollection
()),
zap
.
String
(
"channel"
,
task
.
getChannelName
())
)
result
,
err
:=
task
.
compact
()
if
err
!=
nil
{
...
...
internal/datanode/compactor.go
浏览文件 @
f57fe6d7
...
...
@@ -200,7 +200,7 @@ func (t *compactionTask) mergeDeltalogs(dBlobs map[UniqueID][]*Blob, timetravelT
dbuff
.
accumulateEntriesNum
(
dbuff
.
delData
.
RowCount
)
log
.
Info
(
"mergeDeltalogs end"
,
zap
.
Int
(
"number of pks to compact in insert logs"
,
len
(
pk2ts
)),
zap
.
Int
(
"number of
deleted
pks to compact in insert logs"
,
len
(
pk2ts
)),
zap
.
Float64
(
"elapse in ms"
,
nano2Milli
(
time
.
Since
(
mergeStart
))))
return
pk2ts
,
dbuff
,
nil
...
...
@@ -392,21 +392,21 @@ func (t *compactionTask) merge(
downloadStart
:=
time
.
Now
()
data
,
err
:=
t
.
download
(
ctxTimeout
,
path
)
if
err
!=
nil
{
log
.
Warn
(
"download insertlogs wrong"
,
zap
.
Error
(
err
))
log
.
Warn
(
"download insertlogs wrong"
,
zap
.
Strings
(
"path"
,
path
),
zap
.
Error
(
err
))
return
nil
,
nil
,
0
,
err
}
downloadTimeCost
+=
time
.
Since
(
downloadStart
)
iter
,
err
:=
storage
.
NewInsertBinlogIterator
(
data
,
pkID
,
pkType
)
if
err
!=
nil
{
log
.
Warn
(
"new insert binlogs Itr wrong"
,
zap
.
Error
(
err
))
log
.
Warn
(
"new insert binlogs Itr wrong"
,
zap
.
Strings
(
"path"
,
path
),
zap
.
Error
(
err
))
return
nil
,
nil
,
0
,
err
}
for
iter
.
HasNext
()
{
vInter
,
_
:=
iter
.
Next
()
v
,
ok
:=
vInter
.
(
*
storage
.
Value
)
if
!
ok
{
log
.
Warn
(
"transfer interface to Value wrong"
)
log
.
Warn
(
"transfer interface to Value wrong"
,
zap
.
Strings
(
"path"
,
path
)
)
return
nil
,
nil
,
0
,
errors
.
New
(
"unexpected error"
)
}
...
...
@@ -423,7 +423,7 @@ func (t *compactionTask) merge(
row
,
ok
:=
v
.
Value
.
(
map
[
UniqueID
]
interface
{})
if
!
ok
{
log
.
Warn
(
"transfer interface to map wrong"
)
log
.
Warn
(
"transfer interface to map wrong"
,
zap
.
Strings
(
"path"
,
path
)
)
return
nil
,
nil
,
0
,
errors
.
New
(
"unexpected error"
)
}
...
...
@@ -644,7 +644,7 @@ func (t *compactionTask) compact() (*datapb.CompactionResult, error) {
dmu
sync
.
Mutex
)
allP
s
:=
make
([][]
string
,
0
)
allP
ath
:=
make
([][]
string
,
0
)
downloadStart
:=
time
.
Now
()
g
,
gCtx
:=
errgroup
.
WithContext
(
ctxTimeout
)
...
...
@@ -669,7 +669,7 @@ func (t *compactionTask) compact() (*datapb.CompactionResult, error) {
for
_
,
f
:=
range
s
.
GetFieldBinlogs
()
{
ps
=
append
(
ps
,
f
.
GetBinlogs
()[
idx
]
.
GetLogPath
())
}
allP
s
=
append
(
allPs
,
ps
)
allP
ath
=
append
(
allPath
,
ps
)
}
segID
:=
s
.
GetSegmentID
()
...
...
@@ -679,7 +679,7 @@ func (t *compactionTask) compact() (*datapb.CompactionResult, error) {
g
.
Go
(
func
()
error
{
bs
,
err
:=
t
.
download
(
gCtx
,
[]
string
{
path
})
if
err
!=
nil
{
log
.
Warn
(
"download deltalogs wrong"
)
log
.
Warn
(
"download deltalogs wrong"
,
zap
.
String
(
"path"
,
path
),
zap
.
Error
(
err
)
)
return
err
}
...
...
@@ -709,7 +709,7 @@ func (t *compactionTask) compact() (*datapb.CompactionResult, error) {
return
nil
,
err
}
inPaths
,
statsPaths
,
numRows
,
err
:=
t
.
merge
(
ctxTimeout
,
allP
s
,
targetSegID
,
partID
,
meta
,
deltaPk2Ts
)
inPaths
,
statsPaths
,
numRows
,
err
:=
t
.
merge
(
ctxTimeout
,
allP
ath
,
targetSegID
,
partID
,
meta
,
deltaPk2Ts
)
if
err
!=
nil
{
log
.
Warn
(
"compact wrong"
,
zap
.
Int64
(
"planID"
,
t
.
plan
.
GetPlanID
()),
zap
.
Error
(
err
))
return
nil
,
err
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录