提交 1f6bc4ee 编写于 作者: J jinhai

Merge branch 'branch-0.3.1' into 'branch-0.3.1'

MS-148, MS-149: Disable cleanup if mode is read only and fixed searching only one index file issue in distributed mode

See merge request megasearch/milvus!153

Former-commit-id: fcd22551d6b7b588745386b885bd9dafc1a22307
...@@ -25,6 +25,8 @@ Please mark all change in change log and use the ticket from JIRA. ...@@ -25,6 +25,8 @@ Please mark all change in change log and use the ticket from JIRA.
- MS-90 - Fix arch match incorrect on ARM - MS-90 - Fix arch match incorrect on ARM
- MS-99 - Fix compilation bug - MS-99 - Fix compilation bug
- MS-110 - Avoid huge file size - MS-110 - Avoid huge file size
- MS-148 - Disable cleanup if mode is read only
- MS-149 - Fixed searching only one index file issue in distributed mode
## Improvement ## Improvement
- MS-82 - Update server startup welcome message - MS-82 - Update server startup welcome message
......
...@@ -162,7 +162,9 @@ namespace meta { ...@@ -162,7 +162,9 @@ namespace meta {
ENGINE_LOG_DEBUG << "MySQL connection pool: maximum pool size = " << std::to_string(maxPoolSize); ENGINE_LOG_DEBUG << "MySQL connection pool: maximum pool size = " << std::to_string(maxPoolSize);
try { try {
CleanUp(); if (mode_ != Options::MODE::READ_ONLY) {
CleanUp();
}
{ {
ScopedConnection connectionPtr(*mysql_connection_pool_, safe_grab); ScopedConnection connectionPtr(*mysql_connection_pool_, safe_grab);
...@@ -457,7 +459,7 @@ namespace meta { ...@@ -457,7 +459,7 @@ namespace meta {
} //Scoped Connection } //Scoped Connection
if (mode_ != Options::MODE::SINGLE) { if (mode_ == Options::MODE::CLUSTER) {
DeleteTableFiles(table_id); DeleteTableFiles(table_id);
} }
...@@ -1081,10 +1083,10 @@ namespace meta { ...@@ -1081,10 +1083,10 @@ namespace meta {
// } // }
Query getTableFileQuery = connectionPtr->query(); Query getTableFileQuery = connectionPtr->query();
getTableFileQuery << "SELECT engine_type, file_id, file_type, size, date " << getTableFileQuery << "SELECT id, engine_type, file_id, file_type, size, date " <<
"FROM TableFiles " << "FROM TableFiles " <<
"WHERE table_id = " << quote << table_id << " AND " << "WHERE table_id = " << quote << table_id << " AND " <<
"(" << idStr << ");"; "(" << idStr << ");";
ENGINE_LOG_DEBUG << "MySQLMetaImpl::GetTableFiles: " << getTableFileQuery.str(); ENGINE_LOG_DEBUG << "MySQLMetaImpl::GetTableFiles: " << getTableFileQuery.str();
...@@ -1104,6 +1106,8 @@ namespace meta { ...@@ -1104,6 +1106,8 @@ namespace meta {
TableFileSchema file_schema; TableFileSchema file_schema;
file_schema.id_ = resRow["id"];
file_schema.table_id_ = table_id; file_schema.table_id_ = table_id;
file_schema.engine_type_ = resRow["engine_type"]; file_schema.engine_type_ = resRow["engine_type"];
...@@ -1812,7 +1816,9 @@ namespace meta { ...@@ -1812,7 +1816,9 @@ namespace meta {
MySQLMetaImpl::~MySQLMetaImpl() { MySQLMetaImpl::~MySQLMetaImpl() {
// std::lock_guard<std::recursive_mutex> lock(mysql_mutex); // std::lock_guard<std::recursive_mutex> lock(mysql_mutex);
CleanUp(); if (mode_ != Options::MODE::READ_ONLY) {
CleanUp();
}
} }
} // namespace meta } // namespace meta
......
...@@ -53,6 +53,7 @@ RequestHandler::SearchVector(std::vector<thrift::TopKQueryResult> &_return, ...@@ -53,6 +53,7 @@ RequestHandler::SearchVector(std::vector<thrift::TopKQueryResult> &_return,
const std::vector<thrift::RowRecord> &query_record_array, const std::vector<thrift::RowRecord> &query_record_array,
const std::vector<thrift::Range> &query_range_array, const std::vector<thrift::Range> &query_range_array,
const int64_t topk) { const int64_t topk) {
// SERVER_LOG_DEBUG << "Entering RequestHandler::SearchVector";
BaseTaskPtr task_ptr = SearchVectorTask::Create(table_name, std::vector<std::string>(), query_record_array, BaseTaskPtr task_ptr = SearchVectorTask::Create(table_name, std::vector<std::string>(), query_record_array,
query_range_array, topk, _return); query_range_array, topk, _return);
RequestScheduler::ExecTask(task_ptr); RequestScheduler::ExecTask(task_ptr);
...@@ -65,6 +66,7 @@ RequestHandler::SearchVectorInFiles(std::vector<::milvus::thrift::TopKQueryResul ...@@ -65,6 +66,7 @@ RequestHandler::SearchVectorInFiles(std::vector<::milvus::thrift::TopKQueryResul
const std::vector<::milvus::thrift::RowRecord> &query_record_array, const std::vector<::milvus::thrift::RowRecord> &query_record_array,
const std::vector<::milvus::thrift::Range> &query_range_array, const std::vector<::milvus::thrift::Range> &query_range_array,
const int64_t topk) { const int64_t topk) {
// SERVER_LOG_DEBUG << "Entering RequestHandler::SearchVectorInFiles. file_id_array size = " << std::to_string(file_id_array.size());
BaseTaskPtr task_ptr = SearchVectorTask::Create(table_name, file_id_array, query_record_array, BaseTaskPtr task_ptr = SearchVectorTask::Create(table_name, file_id_array, query_record_array,
query_range_array, topk, _return); query_range_array, topk, _return);
RequestScheduler::ExecTask(task_ptr); RequestScheduler::ExecTask(task_ptr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册