Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
d340a855
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d340a855
编写于
8月 12, 2019
作者:
J
jinhai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'branch-0.3.1' into branch-0.4.0
Former-commit-id: e17b77bd31bc3920df8d61fb428a2ab4de2230fc
上级
66fb3e20
9ca260e2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
38 addition
and
4 deletion
+38
-4
cpp/CHANGELOG.md
cpp/CHANGELOG.md
+1
-0
cpp/src/db/DBImpl.cpp
cpp/src/db/DBImpl.cpp
+20
-2
cpp/src/db/Utils.cpp
cpp/src/db/Utils.cpp
+3
-1
cpp/src/db/scheduler/task/IndexLoadTask.cpp
cpp/src/db/scheduler/task/IndexLoadTask.cpp
+14
-1
未找到文件。
cpp/CHANGELOG.md
浏览文件 @
d340a855
...
...
@@ -33,6 +33,7 @@ Please mark all change in change log and use the ticket from JIRA.
-
MS-236 - Add MySQLMetaImpl::HasNonIndexFiles
-
MS-257 - Update bzip2 download url
-
MS-288 - Update compile scripts
-
MS-330 - Stability test failed caused by server core dumped
## Improvement
-
MS-156 - Add unittest for merge result functions
...
...
cpp/src/db/DBImpl.cpp
浏览文件 @
d340a855
...
...
@@ -370,6 +370,7 @@ Status DBImpl::MergeFiles(const std::string& table_id, const meta::DateT& date,
const
meta
::
TableFilesSchema
&
files
)
{
ENGINE_LOG_DEBUG
<<
"Merge files for table "
<<
table_id
;
//step 1: create table file
meta
::
TableFileSchema
table_file
;
table_file
.
table_id_
=
table_id
;
table_file
.
date_
=
date
;
...
...
@@ -381,6 +382,7 @@ Status DBImpl::MergeFiles(const std::string& table_id, const meta::DateT& date,
return
status
;
}
//step 2: merge files
ExecutionEnginePtr
index
=
EngineFactory
::
Build
(
table_file
.
dimension_
,
table_file
.
location_
,
(
EngineType
)
table_file
.
engine_type_
);
...
...
@@ -404,9 +406,25 @@ Status DBImpl::MergeFiles(const std::string& table_id, const meta::DateT& date,
if
(
index_size
>=
options_
.
index_trigger_size
)
break
;
}
//step 3: serialize to disk
try
{
index
->
Serialize
();
}
catch
(
std
::
exception
&
ex
)
{
//typical error: out of disk space or permition denied
std
::
string
msg
=
"Serialize merged index encounter exception"
+
std
::
string
(
ex
.
what
());
ENGINE_LOG_ERROR
<<
msg
;
table_file
.
file_type_
=
meta
::
TableFileSchema
::
TO_DELETE
;
status
=
meta_ptr_
->
UpdateTableFile
(
table_file
);
ENGINE_LOG_DEBUG
<<
"Failed to update file to index, mark file: "
<<
table_file
.
file_id_
<<
" to to_delete"
;
index
->
Serialize
();
std
::
cout
<<
"ERROR: failed to persist merged index file: "
<<
table_file
.
location_
<<
", possible out of disk space"
<<
std
::
endl
;
return
Status
::
Error
(
msg
);
}
//step 4: update table files state
if
(
index_size
>=
options_
.
index_trigger_size
)
{
table_file
.
file_type_
=
meta
::
TableFileSchema
::
TO_INDEX
;
}
else
{
...
...
@@ -471,7 +489,7 @@ void DBImpl::BackgroundCompaction(std::set<std::string> table_ids) {
meta_ptr_
->
Archive
();
int
ttl
=
1
;
int
ttl
=
5
*
meta
::
M_SEC
;
//default: file will be deleted after 5 minutes
if
(
options_
.
mode
==
Options
::
MODE
::
CLUSTER
)
{
ttl
=
meta
::
D_SEC
;
}
...
...
cpp/src/db/Utils.cpp
浏览文件 @
d340a855
...
...
@@ -131,7 +131,9 @@ Status GetTableFilePath(const DBMetaOptions& options, meta::TableFileSchema& tab
}
}
return
Status
::
Error
(
"Table file doesn't exist: "
+
table_file
.
file_id_
);
std
::
string
msg
=
"Table file doesn't exist: "
+
table_file
.
file_id_
;
ENGINE_LOG_ERROR
<<
msg
;
return
Status
::
Error
(
msg
);
}
Status
DeleteTableFilePath
(
const
DBMetaOptions
&
options
,
meta
::
TableFileSchema
&
table_file
)
{
...
...
cpp/src/db/scheduler/task/IndexLoadTask.cpp
浏览文件 @
d340a855
...
...
@@ -46,7 +46,20 @@ std::shared_ptr<IScheduleTask> IndexLoadTask::Execute() {
ExecutionEnginePtr
index_ptr
=
EngineFactory
::
Build
(
file_
->
dimension_
,
file_
->
location_
,
(
EngineType
)
file_
->
engine_type_
);
index_ptr
->
Load
();
try
{
index_ptr
->
Load
();
}
catch
(
std
::
exception
&
ex
)
{
//typical error: out of disk space or permition denied
std
::
string
msg
=
"Failed to load index file: "
+
std
::
string
(
ex
.
what
());
ENGINE_LOG_ERROR
<<
msg
;
for
(
auto
&
context
:
search_contexts_
)
{
context
->
IndexSearchDone
(
file_
->
id_
);
//mark as done avoid dead lock, even failed
}
return
nullptr
;
}
size_t
file_size
=
index_ptr
->
PhysicalSize
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录