提交 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.
- MS-90 - Fix arch match incorrect on ARM
- MS-99 - Fix compilation bug
- 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
- MS-82 - Update server startup welcome message
......
......@@ -162,7 +162,9 @@ namespace meta {
ENGINE_LOG_DEBUG << "MySQL connection pool: maximum pool size = " << std::to_string(maxPoolSize);
try {
CleanUp();
if (mode_ != Options::MODE::READ_ONLY) {
CleanUp();
}
{
ScopedConnection connectionPtr(*mysql_connection_pool_, safe_grab);
......@@ -457,7 +459,7 @@ namespace meta {
} //Scoped Connection
if (mode_ != Options::MODE::SINGLE) {
if (mode_ == Options::MODE::CLUSTER) {
DeleteTableFiles(table_id);
}
......@@ -1081,10 +1083,10 @@ namespace meta {
// }
Query getTableFileQuery = connectionPtr->query();
getTableFileQuery << "SELECT engine_type, file_id, file_type, size, date " <<
"FROM TableFiles " <<
"WHERE table_id = " << quote << table_id << " AND " <<
"(" << idStr << ");";
getTableFileQuery << "SELECT id, engine_type, file_id, file_type, size, date " <<
"FROM TableFiles " <<
"WHERE table_id = " << quote << table_id << " AND " <<
"(" << idStr << ");";
ENGINE_LOG_DEBUG << "MySQLMetaImpl::GetTableFiles: " << getTableFileQuery.str();
......@@ -1104,6 +1106,8 @@ namespace meta {
TableFileSchema file_schema;
file_schema.id_ = resRow["id"];
file_schema.table_id_ = table_id;
file_schema.engine_type_ = resRow["engine_type"];
......@@ -1812,7 +1816,9 @@ namespace meta {
MySQLMetaImpl::~MySQLMetaImpl() {
// std::lock_guard<std::recursive_mutex> lock(mysql_mutex);
CleanUp();
if (mode_ != Options::MODE::READ_ONLY) {
CleanUp();
}
}
} // namespace meta
......
......@@ -53,6 +53,7 @@ RequestHandler::SearchVector(std::vector<thrift::TopKQueryResult> &_return,
const std::vector<thrift::RowRecord> &query_record_array,
const std::vector<thrift::Range> &query_range_array,
const int64_t topk) {
// SERVER_LOG_DEBUG << "Entering RequestHandler::SearchVector";
BaseTaskPtr task_ptr = SearchVectorTask::Create(table_name, std::vector<std::string>(), query_record_array,
query_range_array, topk, _return);
RequestScheduler::ExecTask(task_ptr);
......@@ -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::Range> &query_range_array,
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,
query_range_array, topk, _return);
RequestScheduler::ExecTask(task_ptr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册