Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
ef0e3145
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,发现更多精彩内容 >>
未验证
提交
ef0e3145
编写于
2月 08, 2020
作者:
C
Cai Yudong
提交者:
GitHub
2月 08, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#1105 update error message when creating IVFSQ8H index without GPU resources (#1117)
上级
032ac328
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
35 addition
and
39 deletion
+35
-39
CHANGELOG.md
CHANGELOG.md
+1
-0
core/src/db/DBImpl.cpp
core/src/db/DBImpl.cpp
+5
-8
core/src/db/IndexFailedChecker.cpp
core/src/db/IndexFailedChecker.cpp
+11
-14
core/src/db/IndexFailedChecker.h
core/src/db/IndexFailedChecker.h
+3
-4
core/src/db/OngoingFileChecker.h
core/src/db/OngoingFileChecker.h
+1
-1
core/src/db/Types.h
core/src/db/Types.h
+3
-1
core/unittest/db/test_misc.cpp
core/unittest/db/test_misc.cpp
+11
-11
未找到文件。
CHANGELOG.md
浏览文件 @
ef0e3145
...
...
@@ -47,6 +47,7 @@ Please mark all change in change log and use the issue from GitHub
-
\#
966 - Update NOTICE.md
-
\#
1002 - Rename minio to s3 in Storage Config section
-
\#
1078 - Move 'insert_buffer_size' to Cache Config section
-
\#
1105 - Error message is not clear when creating IVFSQ8H index without gpu resources
## Task
...
...
core/src/db/DBImpl.cpp
浏览文件 @
ef0e3145
...
...
@@ -895,7 +895,7 @@ DBImpl::BackgroundBuildIndex() {
Status
status
=
job
->
GetStatus
();
ENGINE_LOG_ERROR
<<
"Building index job "
<<
job
->
id
()
<<
" failed: "
<<
status
.
ToString
();
index_failed_checker_
.
MarkFailedIndexFile
(
file_schema
);
index_failed_checker_
.
MarkFailedIndexFile
(
file_schema
,
status
.
message
()
);
}
else
{
ENGINE_LOG_DEBUG
<<
"Building index job "
<<
job
->
id
()
<<
" succeed."
;
...
...
@@ -1066,13 +1066,10 @@ DBImpl::BuildTableIndexRecursively(const std::string& table_id, const TableIndex
}
// failed to build index for some files, return error
std
::
vector
<
std
::
string
>
failed_files
;
index_failed_checker_
.
GetFailedIndexFileOfTable
(
table_id
,
failed_files
);
if
(
!
failed_files
.
empty
())
{
std
::
string
msg
=
"Failed to build index for "
+
std
::
to_string
(
failed_files
.
size
())
+
((
failed_files
.
size
()
==
1
)
?
" file"
:
" files"
);
msg
+=
", please double check index parameters."
;
return
Status
(
DB_ERROR
,
msg
);
std
::
string
err_msg
;
index_failed_checker_
.
GetErrMsgForTable
(
table_id
,
err_msg
);
if
(
!
err_msg
.
empty
())
{
return
Status
(
DB_ERROR
,
err_msg
);
}
return
Status
::
OK
();
...
...
core/src/db/IndexFailedChecker.cpp
浏览文件 @
ef0e3145
...
...
@@ -15,9 +15,10 @@
// specific language governing permissions and limitations
// under the License.
#include "db/IndexFailedChecker.h"
#include <utility>
#include <vector>
#include "db/IndexFailedChecker.h"
namespace
milvus
{
namespace
engine
{
...
...
@@ -33,35 +34,31 @@ IndexFailedChecker::CleanFailedIndexFileOfTable(const std::string& table_id) {
}
Status
IndexFailedChecker
::
GetFailedIndexFileOfTable
(
const
std
::
string
&
table_id
,
std
::
vector
<
std
::
string
>&
failed_files
)
{
failed_files
.
clear
();
IndexFailedChecker
::
GetErrMsgForTable
(
const
std
::
string
&
table_id
,
std
::
string
&
err_msg
)
{
std
::
lock_guard
<
std
::
mutex
>
lck
(
mutex_
);
auto
iter
=
index_failed_files_
.
find
(
table_id
);
if
(
iter
!=
index_failed_files_
.
end
())
{
File2RefCount
&
failed_map
=
iter
->
second
;
for
(
auto
it_file
=
failed_map
.
begin
();
it_file
!=
failed_map
.
end
();
++
it_file
)
{
failed_files
.
push_back
(
it_file
->
first
);
}
err_msg
=
iter
->
second
.
begin
()
->
second
[
0
];
}
return
Status
::
OK
();
}
Status
IndexFailedChecker
::
MarkFailedIndexFile
(
const
meta
::
TableFileSchema
&
file
)
{
IndexFailedChecker
::
MarkFailedIndexFile
(
const
meta
::
TableFileSchema
&
file
,
const
std
::
string
&
err_msg
)
{
std
::
lock_guard
<
std
::
mutex
>
lck
(
mutex_
);
auto
iter
=
index_failed_files_
.
find
(
file
.
table_id_
);
if
(
iter
==
index_failed_files_
.
end
())
{
File2
RefCount
failed_files
;
failed_files
.
insert
(
std
::
make_pair
(
file
.
file_id_
,
1
));
File2
ErrArray
failed_files
;
failed_files
.
insert
(
std
::
make_pair
(
file
.
file_id_
,
std
::
vector
<
std
::
string
>
(
1
,
err_msg
)
));
index_failed_files_
.
insert
(
std
::
make_pair
(
file
.
table_id_
,
failed_files
));
}
else
{
auto
it_failed_files
=
iter
->
second
.
find
(
file
.
file_id_
);
if
(
it_failed_files
!=
iter
->
second
.
end
())
{
it_failed_files
->
second
++
;
it_failed_files
->
second
.
push_back
(
err_msg
)
;
}
else
{
iter
->
second
.
insert
(
std
::
make_pair
(
file
.
file_id_
,
1
));
iter
->
second
.
insert
(
std
::
make_pair
(
file
.
file_id_
,
std
::
vector
<
std
::
string
>
(
1
,
err_msg
)
));
}
}
...
...
@@ -95,7 +92,7 @@ IndexFailedChecker::IgnoreFailedIndexFiles(meta::TableFilesSchema& table_files)
if
(
it_failed_files
!=
index_failed_files_
.
end
())
{
auto
it_failed_file
=
it_failed_files
->
second
.
find
((
*
it_file
).
file_id_
);
if
(
it_failed_file
!=
it_failed_files
->
second
.
end
())
{
if
(
it_failed_file
->
second
>=
INDEX_FAILED_RETRY_TIME
)
{
if
(
it_failed_file
->
second
.
size
()
>=
INDEX_FAILED_RETRY_TIME
)
{
it_file
=
table_files
.
erase
(
it_file
);
continue
;
}
...
...
core/src/db/IndexFailedChecker.h
浏览文件 @
ef0e3145
...
...
@@ -24,7 +24,6 @@
#include <map>
#include <mutex>
#include <string>
#include <vector>
namespace
milvus
{
namespace
engine
{
...
...
@@ -35,10 +34,10 @@ class IndexFailedChecker {
CleanFailedIndexFileOfTable
(
const
std
::
string
&
table_id
);
Status
Get
FailedIndexFileOfTable
(
const
std
::
string
&
table_id
,
std
::
vector
<
std
::
string
>&
failed_files
);
Get
ErrMsgForTable
(
const
std
::
string
&
table_id
,
std
::
string
&
err_msg
);
Status
MarkFailedIndexFile
(
const
meta
::
TableFileSchema
&
file
);
MarkFailedIndexFile
(
const
meta
::
TableFileSchema
&
file
,
const
std
::
string
&
err_msg
);
Status
MarkSucceedIndexFile
(
const
meta
::
TableFileSchema
&
file
);
...
...
@@ -48,7 +47,7 @@ class IndexFailedChecker {
private:
std
::
mutex
mutex_
;
Table2File
s
index_failed_files_
;
// table id mapping to (file id mapping to failed times)
Table2File
Err
index_failed_files_
;
// table id mapping to (file id mapping to failed times)
};
}
// namespace engine
...
...
core/src/db/OngoingFileChecker.h
浏览文件 @
ef0e3145
...
...
@@ -55,7 +55,7 @@ class OngoingFileChecker : public meta::Meta::CleanUpFilter {
private:
std
::
mutex
mutex_
;
Table2File
s
ongoing_files_
;
// table id mapping to (file id mapping to ongoing ref-count)
Table2File
Ref
ongoing_files_
;
// table id mapping to (file id mapping to ongoing ref-count)
};
}
// namespace engine
...
...
core/src/db/Types.h
浏览文件 @
ef0e3145
...
...
@@ -50,8 +50,10 @@ struct VectorsData {
IDNumbers
id_array_
;
};
using
File2ErrArray
=
std
::
map
<
std
::
string
,
std
::
vector
<
std
::
string
>>
;
using
Table2FileErr
=
std
::
map
<
std
::
string
,
File2ErrArray
>
;
using
File2RefCount
=
std
::
map
<
std
::
string
,
int64_t
>
;
using
Table2File
s
=
std
::
map
<
std
::
string
,
File2RefCount
>
;
using
Table2File
Ref
=
std
::
map
<
std
::
string
,
File2RefCount
>
;
}
// namespace engine
}
// namespace milvus
core/unittest/db/test_misc.cpp
浏览文件 @
ef0e3145
...
...
@@ -128,30 +128,30 @@ TEST(DBMiscTest, CHECKER_TEST) {
milvus
::
engine
::
meta
::
TableFileSchema
schema
;
schema
.
table_id_
=
"aaa"
;
schema
.
file_id_
=
"5000"
;
checker
.
MarkFailedIndexFile
(
schema
);
checker
.
MarkFailedIndexFile
(
schema
,
"5000 fail"
);
schema
.
table_id_
=
"bbb"
;
schema
.
file_id_
=
"5001"
;
checker
.
MarkFailedIndexFile
(
schema
);
checker
.
MarkFailedIndexFile
(
schema
,
"5001 fail"
);
std
::
vector
<
std
::
string
>
failed_files
;
checker
.
Get
FailedIndexFileOfTable
(
"aaa"
,
failed_files
);
ASSERT_EQ
(
failed_files
.
size
(),
1UL
);
std
::
string
err_msg
;
checker
.
Get
ErrMsgForTable
(
"aaa"
,
err_msg
);
ASSERT_EQ
(
err_msg
,
"5000 fail"
);
schema
.
table_id_
=
"bbb"
;
schema
.
file_id_
=
"5002"
;
checker
.
MarkFailedIndexFile
(
schema
);
checker
.
MarkFailedIndexFile
(
schema
);
checker
.
MarkFailedIndexFile
(
schema
,
"5002 fail"
);
checker
.
MarkFailedIndexFile
(
schema
,
"5002 fail"
);
milvus
::
engine
::
meta
::
TableFilesSchema
table_files
=
{
schema
};
checker
.
IgnoreFailedIndexFiles
(
table_files
);
ASSERT_TRUE
(
table_files
.
empty
());
checker
.
Get
FailedIndexFileOfTable
(
"bbb"
,
failed_files
);
ASSERT_EQ
(
failed_files
.
size
(),
2UL
);
checker
.
Get
ErrMsgForTable
(
"bbb"
,
err_msg
);
ASSERT_EQ
(
err_msg
,
"5001 fail"
);
checker
.
MarkSucceedIndexFile
(
schema
);
checker
.
Get
FailedIndexFileOfTable
(
"bbb"
,
failed_files
);
ASSERT_EQ
(
failed_files
.
size
(),
1UL
);
checker
.
Get
ErrMsgForTable
(
"bbb"
,
err_msg
);
ASSERT_EQ
(
err_msg
,
"5001 fail"
);
}
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录