From de751bd680a4ffa6ade2cc3b4eadd9f62d8ebe2d Mon Sep 17 00:00:00 2001 From: zhiru Date: Thu, 27 Jun 2019 16:54:16 +0800 Subject: [PATCH] temporarily disable decrementing conns_in_use_ when it's already <= 0 Former-commit-id: d2c874147a4b0ae529a5b3b44c9186566ac2d174 --- cpp/conf/log_config.conf | 4 ++-- cpp/conf/server_config.yaml | 9 +++++---- cpp/src/db/MySQLConnectionPool.h | 6 ++++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cpp/conf/log_config.conf b/cpp/conf/log_config.conf index 80710b57..79a39657 100644 --- a/cpp/conf/log_config.conf +++ b/cpp/conf/log_config.conf @@ -20,8 +20,8 @@ TO_STANDARD_OUTPUT = false ## Error logs * ERROR: - ENABLED = false + ENABLED = true FILENAME = "/tmp/milvus/logs/milvus-%datetime{%H:%m}-error.log" * FATAL: - ENABLED = false + ENABLED = true FILENAME = "/tmp/milvus/logs/milvus-%datetime{%H:%m}-fatal.log" \ No newline at end of file diff --git a/cpp/conf/server_config.yaml b/cpp/conf/server_config.yaml index dcf23d17..c918c749 100644 --- a/cpp/conf/server_config.yaml +++ b/cpp/conf/server_config.yaml @@ -1,15 +1,16 @@ server_config: address: 0.0.0.0 - port: 19530 # the port milvus listen to, default: 19530, range: 1025 ~ 65534 + port: 19531 # the port milvus listen to, default: 19530, range: 1025 ~ 65534 gpu_index: 0 # the gpu milvus use, default: 0, range: 0 ~ gpu number - 1 - mode: single # milvus deployment type: single, cluster + mode: cluster # milvus deployment type: single, cluster db_config: db_path: /tmp/milvus #URI format: dialect://username:password@host:port/database #All parts except dialect are optional, but you MUST include the delimiters - db_backend_url: mysql://root:1234@:/test - index_building_threshold: 1024 #build index file when raw data file size larger than this value, unit: MB + #Currently supports mysql or sqlite + db_backend_url: mysql://root:1234@:/test # meta database uri + index_building_threshold: 1024 # index building trigger threshold, default: 1024, unit: MB metric_config: is_startup: off # if monitoring start: on, off diff --git a/cpp/src/db/MySQLConnectionPool.h b/cpp/src/db/MySQLConnectionPool.h index ade150a6..c1ea2e83 100644 --- a/cpp/src/db/MySQLConnectionPool.h +++ b/cpp/src/db/MySQLConnectionPool.h @@ -54,10 +54,12 @@ public: void release(const mysqlpp::Connection* pc) override { mysqlpp::ConnectionPool::release(pc); // ENGINE_LOG_DEBUG << "conns_in_use_ in release: " << conns_in_use_ << std::endl; - --conns_in_use_; - if (conns_in_use_ < 0) { + if (conns_in_use_ <= 0) { ENGINE_LOG_WARNING << "MySQLConnetionPool::release: conns_in_use_ is less than zero. conns_in_use_ = " << conns_in_use_ << std::endl; } + else { + --conns_in_use_; + } } void set_max_idle_time(int max_idle) { -- GitLab