From 1502cf87e0d6fa0847125e629b2cbd552a0387ed Mon Sep 17 00:00:00 2001 From: groot Date: Fri, 15 Nov 2019 14:31:51 +0800 Subject: [PATCH 1/3] #340 Test cases run failed on 0.6.0 --- CHANGELOG.md | 1 + core/src/db/DBImpl.cpp | 16 ++++++++-------- core/src/db/DBImpl.h | 3 ++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 745310faa7..7d7049f60e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Please mark all change in change log and use the ticket from JIRA. - \#246 - Exclude src/external folder from code coverage for jenkin ci - \#248 - Reside src/external in thirdparty - \#316 - Some files not merged after vectors added +- \#340 - Test cases run failed on 0.6.0 ## Feature - \#12 - Pure CPU version for Milvus diff --git a/core/src/db/DBImpl.cpp b/core/src/db/DBImpl.cpp index d688c88ff2..760e82414f 100644 --- a/core/src/db/DBImpl.cpp +++ b/core/src/db/DBImpl.cpp @@ -179,9 +179,10 @@ DBImpl::PreloadTable(const std::string& table_id) { } // get all table files from parent table + meta::DatesT dates; std::vector ids; meta::TableFilesSchema files_array; - auto status = GetFilesToSearch(table_id, ids, files_array); + auto status = GetFilesToSearch(table_id, ids, dates, files_array); if (!status.ok()) { return status; } @@ -190,7 +191,7 @@ DBImpl::PreloadTable(const std::string& table_id) { std::vector partiton_array; status = meta_ptr_->ShowPartitions(table_id, partiton_array); for (auto& schema : partiton_array) { - status = GetFilesToSearch(schema.table_id_, ids, files_array); + status = GetFilesToSearch(schema.table_id_, ids, dates, files_array); } int64_t size = 0; @@ -400,7 +401,7 @@ DBImpl::Query(const std::string& table_id, const std::vector& parti if (partition_tags.empty()) { // no partition tag specified, means search in whole table // get all table files from parent table - status = GetFilesToSearch(table_id, ids, files_array); + status = GetFilesToSearch(table_id, ids, dates, files_array); if (!status.ok()) { return status; } @@ -408,7 +409,7 @@ DBImpl::Query(const std::string& table_id, const std::vector& parti std::vector partiton_array; status = meta_ptr_->ShowPartitions(table_id, partiton_array); for (auto& schema : partiton_array) { - status = GetFilesToSearch(schema.table_id_, ids, files_array); + status = GetFilesToSearch(schema.table_id_, ids, dates, files_array); } } else { // get files from specified partitions @@ -416,7 +417,7 @@ DBImpl::Query(const std::string& table_id, const std::vector& parti GetPartitionsByTags(table_id, partition_tags, partition_name_array); for (auto& partition_name : partition_name_array) { - status = GetFilesToSearch(partition_name, ids, files_array); + status = GetFilesToSearch(partition_name, ids, dates, files_array); } } @@ -446,7 +447,7 @@ DBImpl::QueryByFileID(const std::string& table_id, const std::vector& file_ids, +DBImpl::GetFilesToSearch(const std::string& table_id, const std::vector& file_ids, const meta::DatesT& dates, meta::TableFilesSchema& files) { - meta::DatesT dates; meta::DatePartionedTableFilesSchema date_files; auto status = meta_ptr_->FilesToSearch(table_id, file_ids, dates, date_files); if (!status.ok()) { diff --git a/core/src/db/DBImpl.h b/core/src/db/DBImpl.h index 932fc990e4..95e7cd3587 100644 --- a/core/src/db/DBImpl.h +++ b/core/src/db/DBImpl.h @@ -153,7 +153,8 @@ class DBImpl : public DB { MemSerialize(); Status - GetFilesToSearch(const std::string& table_id, const std::vector& file_ids, meta::TableFilesSchema& files); + GetFilesToSearch(const std::string& table_id, const std::vector& file_ids, const meta::DatesT& dates, + meta::TableFilesSchema& files); Status GetPartitionsByTags(const std::string& table_id, const std::vector& partition_tags, From 33b31b3d49c24d86d9b98d6970aef92bb685700e Mon Sep 17 00:00:00 2001 From: groot Date: Fri, 15 Nov 2019 14:33:11 +0800 Subject: [PATCH 2/3] code lint --- core/src/db/DBImpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/db/DBImpl.h b/core/src/db/DBImpl.h index 95e7cd3587..a0c5cc356d 100644 --- a/core/src/db/DBImpl.h +++ b/core/src/db/DBImpl.h @@ -154,7 +154,7 @@ class DBImpl : public DB { Status GetFilesToSearch(const std::string& table_id, const std::vector& file_ids, const meta::DatesT& dates, - meta::TableFilesSchema& files); + meta::TableFilesSchema& files); Status GetPartitionsByTags(const std::string& table_id, const std::vector& partition_tags, From d93182a20929f923bda015dcf3b86ac35ef1fbaa Mon Sep 17 00:00:00 2001 From: groot Date: Fri, 15 Nov 2019 16:18:34 +0800 Subject: [PATCH 3/3] allow empty partition name --- core/src/db/DBImpl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/db/DBImpl.cpp b/core/src/db/DBImpl.cpp index 760e82414f..2559b3a46b 100644 --- a/core/src/db/DBImpl.cpp +++ b/core/src/db/DBImpl.cpp @@ -305,6 +305,10 @@ DBImpl::InsertVectors(const std::string& table_id, const std::string& partition_ if (!partition_tag.empty()) { std::string partition_name; status = meta_ptr_->GetPartitionName(table_id, partition_tag, target_table_name); + if (!status.ok()) { + ENGINE_LOG_ERROR << status.message(); + return status; + } } // insert vectors into target table