diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index b2e11cd83c82760e5d6dd4c2becb0e496e3f8ac2..cf73d770e2694b8923958335e04b9a772e8d4d13 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -44,6 +44,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-305 - Add CPU core percent metric - MS-310 - Add milvus CPU utilization ratio and CPU/GPU temperature metrics - MS-324 - Show error when there is not enough gpu memory to build index +- MS-328 - Check metric type on server start ## New Feature - MS-180 - Add new mem manager diff --git a/cpp/src/server/DBWrapper.cpp b/cpp/src/server/DBWrapper.cpp index fbe630a803c809bce31aee2382ca5ddd681a1b54..a84e9a2dd83184045673d0d39f999fcd0e0f7923 100644 --- a/cpp/src/server/DBWrapper.cpp +++ b/cpp/src/server/DBWrapper.cpp @@ -74,6 +74,12 @@ DBWrapper::DBWrapper() { } } + std::string metric_type = engine_config.GetValue(CONFIG_METRICTYPE, "L2"); + if(metric_type != "L2" && metric_type != "IP") { + std::cout << "ERROR! Illegal metric type: " << metric_type << ", available options: L2 or IP" << std::endl; + kill(0, SIGUSR1); + } + //set archive config engine::ArchiveConf::CriteriaT criterial; int64_t disk = db_config.GetInt64Value(CONFIG_DB_ARCHIVE_DISK, 0); @@ -101,6 +107,7 @@ DBWrapper::DBWrapper() { } } + //create db instance std::string msg = opt.meta.path; try { zilliz::milvus::engine::DB::Open(opt, &db_);