未验证 提交 0e25bab6 编写于 作者: B BossZou 提交者: GitHub

Fix inconsistent reading and writing when using mishards (# 2367) (#2442)

* Fix inconsistent reading and writing when using mishards (# 2367)
Signed-off-by: Nyhz <413554850@qq.com>

* CI retry
Signed-off-by: Nyhz <413554850@qq.com>
上级 7c72dcf4
...@@ -4,6 +4,7 @@ Please mark all change in change log and use the issue from GitHub ...@@ -4,6 +4,7 @@ Please mark all change in change log and use the issue from GitHub
# Milvus 0.10.0 (TBD) # Milvus 0.10.0 (TBD)
## Bug ## Bug
- \#2367 Fix inconsistent reading and writing when using mishards
## Feature ## Feature
- \#2363 Update branch version - \#2363 Update branch version
......
...@@ -2320,12 +2320,6 @@ MySQLMetaImpl::FilesByID(const std::vector<size_t>& ids, FilesHolder& files_hold ...@@ -2320,12 +2320,6 @@ MySQLMetaImpl::FilesByID(const std::vector<size_t>& ids, FilesHolder& files_hold
statement << " WHERE (" << idStr << ")"; statement << " WHERE (" << idStr << ")";
// End
statement << " AND"
<< " (file_type = " << std::to_string(SegmentSchema::RAW)
<< " OR file_type = " << std::to_string(SegmentSchema::TO_INDEX)
<< " OR file_type = " << std::to_string(SegmentSchema::INDEX) << ");";
LOG_ENGINE_DEBUG_ << "FilesToSearch: " << statement.str(); LOG_ENGINE_DEBUG_ << "FilesToSearch: " << statement.str();
res = statement.store(); res = statement.store();
......
...@@ -1652,14 +1652,10 @@ SqliteMetaImpl::FilesByID(const std::vector<size_t>& ids, FilesHolder& files_hol ...@@ -1652,14 +1652,10 @@ SqliteMetaImpl::FilesByID(const std::vector<size_t>& ids, FilesHolder& files_hol
&SegmentSchema::created_on_, &SegmentSchema::created_on_,
&SegmentSchema::updated_time_); &SegmentSchema::updated_time_);
std::vector<int> file_types = {(int)SegmentSchema::RAW, (int)SegmentSchema::TO_INDEX,
(int)SegmentSchema::INDEX};
auto match_type = in(&SegmentSchema::file_type_, file_types);
// perform query // perform query
decltype(ConnectorPtr->select(select_columns)) selected; decltype(ConnectorPtr->select(select_columns)) selected;
auto match_fileid = in(&SegmentSchema::id_, ids); auto match_fileid = in(&SegmentSchema::id_, ids);
auto filter = where(match_fileid and match_type); auto filter = where(match_fileid);
{ {
// multi-threads call sqlite update may get exception('bad logic', etc), so we add a lock here // multi-threads call sqlite update may get exception('bad logic', etc), so we add a lock here
std::lock_guard<std::mutex> meta_lock(meta_mutex_); std::lock_guard<std::mutex> meta_lock(meta_mutex_);
......
...@@ -354,7 +354,7 @@ class WebControllerTest : public ::testing::Test { ...@@ -354,7 +354,7 @@ class WebControllerTest : public ::testing::Test {
static void static void
SetUpTestCase() { SetUpTestCase() {
mkdir(CONTROLLER_TEST_CONFIG_DIR, S_IRWXU); mkdir(CONTROLLER_TEST_CONFIG_DIR, S_IRWXU);
// Basic config // Load basic config
std::string config_path = std::string(CONTROLLER_TEST_CONFIG_DIR).append(CONTROLLER_TEST_CONFIG_FILE); std::string config_path = std::string(CONTROLLER_TEST_CONFIG_DIR).append(CONTROLLER_TEST_CONFIG_FILE);
std::fstream fs(config_path.c_str(), std::ios_base::out); std::fstream fs(config_path.c_str(), std::ios_base::out);
fs << CONTROLLER_TEST_VALID_CONFIG_STR; fs << CONTROLLER_TEST_VALID_CONFIG_STR;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册