#1463 update config version to 0.2 (#1466)

* #1463 update config version to 0.2

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>

* #1463 disable config version check

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
pull/1502/head^2
Cai Yudong 2020-03-04 00:02:48 +08:00 committed by GitHub
parent 962a00c366
commit 600dac7500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 15 deletions

View File

@ -50,6 +50,7 @@ Please mark all change in change log and use the issue from GitHub
- \#1250 Support CPU profiling
- \#1302 Get all record IDs in a segment by given a segment id
- \#1461 Add crud APIs and segments APIs into http module
- \#1463 Update config version to 0.2
## Improvement
- \#738 Use Openblas / lapack from apt install

View File

@ -9,7 +9,7 @@
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
version: 0.1
version: 0.2
#----------------------+------------------------------------------------------------+------------+-----------------+
# Server Config | Description | Type | Default |

View File

@ -9,7 +9,7 @@
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
version: 0.1
version: 0.2
#----------------------+------------------------------------------------------------+------------+-----------------+
# Server Config | Description | Type | Default |

View File

@ -9,7 +9,7 @@
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
version: 0.1
version: 0.2
#----------------------+------------------------------------------------------------+------------+-----------------+
# Server Config | Description | Type | Default |

View File

@ -38,7 +38,8 @@ namespace server {
constexpr int64_t GB = 1UL << 30;
static const std::unordered_map<std::string, std::string> milvus_config_version_map({{"0.7.0", "0.1"}});
static const std::unordered_map<std::string, std::string> milvus_config_version_map({{"0.6.0", "0.1"},
{"0.7.0", "0.2"}});
/////////////////////////////////////////////////////////////
Config::Config() {
@ -609,12 +610,15 @@ Config::CancelCallBack(const std::string& node, const std::string& sub_node, con
////////////////////////////////////////////////////////////////////////////////
Status
Config::CheckConfigVersion(const std::string& value) {
bool exist_error = milvus_config_version_map.at(MILVUS_VERSION) != value;
fiu_do_on("check_config_version_fail", exist_error = true);
if (exist_error) {
std::string msg = "Invalid config version: " + value +
". Expected config version: " + milvus_config_version_map.at(MILVUS_VERSION);
return Status(SERVER_INVALID_ARGUMENT, msg);
if (milvus_config_version_map.find(MILVUS_VERSION) != milvus_config_version_map.end()) {
bool exist_error = milvus_config_version_map.at(MILVUS_VERSION) != value;
fiu_do_on("check_config_version_fail", exist_error = true);
if (exist_error) {
std::string msg = "Invalid config version: " + value +
". Expected config version: " + milvus_config_version_map.at(MILVUS_VERSION);
SERVER_LOG_ERROR << msg;
// return Status(SERVER_INVALID_ARGUMENT, msg);
}
}
return Status::OK();
}

View File

@ -650,10 +650,10 @@ TEST_F(ConfigTest, SERVER_CONFIG_VALID_FAIL_TEST) {
milvus::Status s = config.LoadConfigFile(config_path + VALID_CONFIG_FILE);
ASSERT_TRUE(s.ok());
fiu_enable("check_config_version_fail", 1, NULL, 0);
s = config.ValidateConfig();
ASSERT_FALSE(s.ok());
fiu_disable("check_config_version_fail");
// fiu_enable("check_config_version_fail", 1, NULL, 0);
// s = config.ValidateConfig();
// ASSERT_FALSE(s.ok());
// fiu_disable("check_config_version_fail");
/* server config */
fiu_enable("check_config_address_fail", 1, NULL, 0);

View File

@ -22,7 +22,7 @@ namespace {
static const char* VALID_CONFIG_STR =
"# Default values are used when you make no changes to the following parameters.\n"
"\n"
"version: 0.1"
"version: 0.2"
"\n"
"server_config:\n"
" address: 0.0.0.0 # milvus server ip address (IPv4)\n"