From 62b6db567d0990144b28b7e684b255d0cce2c030 Mon Sep 17 00:00:00 2001 From: groot Date: Mon, 2 Dec 2019 11:57:43 +0800 Subject: [PATCH] add more logs --- core/src/db/DBImpl.cpp | 1 - core/src/db/engine/ExecutionEngineImpl.cpp | 2 ++ core/src/server/grpc_impl/request/CmdRequest.cpp | 5 +++++ core/src/server/grpc_impl/request/CountTableRequest.cpp | 3 ++- core/src/server/grpc_impl/request/CreateIndexRequest.cpp | 3 ++- .../src/server/grpc_impl/request/CreatePartitionRequest.cpp | 6 +++++- core/src/server/grpc_impl/request/CreateTableRequest.cpp | 5 ++++- core/src/server/grpc_impl/request/DescribeIndexRequest.cpp | 3 ++- core/src/server/grpc_impl/request/DescribeTableRequest.cpp | 3 ++- core/src/server/grpc_impl/request/DropIndexRequest.cpp | 3 ++- core/src/server/grpc_impl/request/DropPartitionRequest.cpp | 5 +++++ core/src/server/grpc_impl/request/DropTableRequest.cpp | 3 ++- core/src/server/grpc_impl/request/HasTableRequest.cpp | 3 ++- core/src/server/grpc_impl/request/InsertRequest.cpp | 3 ++- core/src/server/grpc_impl/request/PreloadTableRequest.cpp | 3 ++- core/src/server/grpc_impl/request/ShowPartitionsRequest.cpp | 3 +++ core/src/server/grpc_impl/request/ShowTablesRequest.cpp | 2 ++ 17 files changed, 44 insertions(+), 12 deletions(-) diff --git a/core/src/db/DBImpl.cpp b/core/src/db/DBImpl.cpp index 779e1b731f..8f8516770f 100644 --- a/core/src/db/DBImpl.cpp +++ b/core/src/db/DBImpl.cpp @@ -695,7 +695,6 @@ DBImpl::MergeFiles(const std::string& table_id, const meta::DateT& date, const m auto file_schema = file; file_schema.file_type_ = meta::TableFileSchema::TO_DELETE; updated.push_back(file_schema); - ENGINE_LOG_DEBUG << "Merging file " << file_schema.file_id_; index_size = index->Size(); if (index_size >= file_schema.index_file_size_) { diff --git a/core/src/db/engine/ExecutionEngineImpl.cpp b/core/src/db/engine/ExecutionEngineImpl.cpp index 9464d66f28..f3fd4a67cf 100644 --- a/core/src/db/engine/ExecutionEngineImpl.cpp +++ b/core/src/db/engine/ExecutionEngineImpl.cpp @@ -472,6 +472,8 @@ ExecutionEngineImpl::Merge(const std::string& location) { auto status = index_->Add(file_index->Count(), file_index->GetRawVectors(), file_index->GetRawIds()); if (!status.ok()) { ENGINE_LOG_ERROR << "Failed to merge: " << location << " to: " << location_; + } else { + ENGINE_LOG_DEBUG << "Finish merge index file: " << location; } return status; } else { diff --git a/core/src/server/grpc_impl/request/CmdRequest.cpp b/core/src/server/grpc_impl/request/CmdRequest.cpp index b215f94d31..e3e2c06ad8 100644 --- a/core/src/server/grpc_impl/request/CmdRequest.cpp +++ b/core/src/server/grpc_impl/request/CmdRequest.cpp @@ -17,6 +17,8 @@ #include "server/grpc_impl/request/CmdRequest.h" #include "scheduler/SchedInst.h" +#include "utils/Log.h" +#include "utils/TimeRecorder.h" #include @@ -35,6 +37,9 @@ CmdRequest::Create(const std::string& cmd, std::string& result) { Status CmdRequest::OnExecute() { + std::string hdr = "CmdRequest(cmd=" + cmd_ + ")"; + TimeRecorder rc(hdr); + if (cmd_ == "version") { result_ = MILVUS_VERSION; } else if (cmd_ == "tasktable") { diff --git a/core/src/server/grpc_impl/request/CountTableRequest.cpp b/core/src/server/grpc_impl/request/CountTableRequest.cpp index 8559890ad6..b90a33bf61 100644 --- a/core/src/server/grpc_impl/request/CountTableRequest.cpp +++ b/core/src/server/grpc_impl/request/CountTableRequest.cpp @@ -39,7 +39,8 @@ CountTableRequest::Create(const std::string& table_name, int64_t& row_count) { Status CountTableRequest::OnExecute() { try { - TimeRecorder rc("CountTableRequest"); + std::string hdr = "CountTableRequest(table=" + table_name_ + ")"; + TimeRecorder rc(hdr); // step 1: check arguments auto status = ValidationUtil::ValidateTableName(table_name_); diff --git a/core/src/server/grpc_impl/request/CreateIndexRequest.cpp b/core/src/server/grpc_impl/request/CreateIndexRequest.cpp index 72678aee87..c7628048ff 100644 --- a/core/src/server/grpc_impl/request/CreateIndexRequest.cpp +++ b/core/src/server/grpc_impl/request/CreateIndexRequest.cpp @@ -44,7 +44,8 @@ CreateIndexRequest::Create(const ::milvus::grpc::IndexParam* index_param) { Status CreateIndexRequest::OnExecute() { try { - TimeRecorder rc("CreateIndexRequest"); + std::string hdr = "CreateIndexRequest(table=" + index_param_->table_name() + ")"; + TimeRecorder rc(hdr); // step 1: check arguments std::string table_name_ = index_param_->table_name(); diff --git a/core/src/server/grpc_impl/request/CreatePartitionRequest.cpp b/core/src/server/grpc_impl/request/CreatePartitionRequest.cpp index 3bd4a86ef6..1a18cdfcad 100644 --- a/core/src/server/grpc_impl/request/CreatePartitionRequest.cpp +++ b/core/src/server/grpc_impl/request/CreatePartitionRequest.cpp @@ -22,6 +22,7 @@ #include "utils/ValidationUtil.h" #include +#include namespace milvus { namespace server { @@ -42,7 +43,10 @@ CreatePartitionRequest::Create(const ::milvus::grpc::PartitionParam* partition_p Status CreatePartitionRequest::OnExecute() { - TimeRecorder rc("CreatePartitionRequest"); + std::string hdr = "CreatePartitionRequest(table=" + partition_param_->table_name() + + ", partition_name=" + partition_param_->partition_name() + + ", partition_tag=" + partition_param_->tag() + ")"; + TimeRecorder rc(hdr); try { // step 1: check arguments diff --git a/core/src/server/grpc_impl/request/CreateTableRequest.cpp b/core/src/server/grpc_impl/request/CreateTableRequest.cpp index 67a3eaa877..55d953aa6f 100644 --- a/core/src/server/grpc_impl/request/CreateTableRequest.cpp +++ b/core/src/server/grpc_impl/request/CreateTableRequest.cpp @@ -22,6 +22,7 @@ #include "utils/ValidationUtil.h" #include +#include namespace milvus { namespace server { @@ -42,7 +43,9 @@ CreateTableRequest::Create(const ::milvus::grpc::TableSchema* schema) { Status CreateTableRequest::OnExecute() { - TimeRecorder rc("CreateTableRequest"); + std::string hdr = "CreateTableRequest(table=" + schema_->table_name() + + ", dimension=" + std::to_string(schema_->dimension()) + ")"; + TimeRecorder rc(hdr); try { // step 1: check arguments diff --git a/core/src/server/grpc_impl/request/DescribeIndexRequest.cpp b/core/src/server/grpc_impl/request/DescribeIndexRequest.cpp index b3a987c6b0..d57d47bf2c 100644 --- a/core/src/server/grpc_impl/request/DescribeIndexRequest.cpp +++ b/core/src/server/grpc_impl/request/DescribeIndexRequest.cpp @@ -39,7 +39,8 @@ DescribeIndexRequest::Create(const std::string& table_name, ::milvus::grpc::Inde Status DescribeIndexRequest::OnExecute() { try { - TimeRecorder rc("DescribeIndexRequest"); + std::string hdr = "DescribeIndexRequest(table=" + table_name_ + ")"; + TimeRecorder rc(hdr); // step 1: check arguments auto status = ValidationUtil::ValidateTableName(table_name_); diff --git a/core/src/server/grpc_impl/request/DescribeTableRequest.cpp b/core/src/server/grpc_impl/request/DescribeTableRequest.cpp index 28a5f327c5..3bd97ef7e8 100644 --- a/core/src/server/grpc_impl/request/DescribeTableRequest.cpp +++ b/core/src/server/grpc_impl/request/DescribeTableRequest.cpp @@ -38,7 +38,8 @@ DescribeTableRequest::Create(const std::string& table_name, ::milvus::grpc::Tabl Status DescribeTableRequest::OnExecute() { - TimeRecorder rc("DescribeTableRequest"); + std::string hdr = "DescribeTableRequest(table=" + table_name_ + ")"; + TimeRecorder rc(hdr); try { // step 1: check arguments diff --git a/core/src/server/grpc_impl/request/DropIndexRequest.cpp b/core/src/server/grpc_impl/request/DropIndexRequest.cpp index ab5c83b0e5..619ea753ba 100644 --- a/core/src/server/grpc_impl/request/DropIndexRequest.cpp +++ b/core/src/server/grpc_impl/request/DropIndexRequest.cpp @@ -39,7 +39,8 @@ DropIndexRequest::Create(const std::string& table_name) { Status DropIndexRequest::OnExecute() { try { - TimeRecorder rc("DropIndexRequest"); + std::string hdr = "DropIndexRequest(table=" + table_name_ + ")"; + TimeRecorder rc(hdr); // step 1: check arguments auto status = ValidationUtil::ValidateTableName(table_name_); diff --git a/core/src/server/grpc_impl/request/DropPartitionRequest.cpp b/core/src/server/grpc_impl/request/DropPartitionRequest.cpp index 0e29b6abe8..1ec189986a 100644 --- a/core/src/server/grpc_impl/request/DropPartitionRequest.cpp +++ b/core/src/server/grpc_impl/request/DropPartitionRequest.cpp @@ -39,6 +39,11 @@ DropPartitionRequest::Create(const ::milvus::grpc::PartitionParam* partition_par Status DropPartitionRequest::OnExecute() { + std::string hdr = "DropPartitionRequest(table=" + partition_param_->table_name() + + ", partition_name=" + partition_param_->partition_name() + + ", partition_tag=" + partition_param_->tag() + ")"; + TimeRecorder rc(hdr); + std::string table_name = partition_param_->table_name(); std::string partition_name = partition_param_->partition_name(); std::string partition_tag = partition_param_->tag(); diff --git a/core/src/server/grpc_impl/request/DropTableRequest.cpp b/core/src/server/grpc_impl/request/DropTableRequest.cpp index a678e5a6f6..6f81a5b2a0 100644 --- a/core/src/server/grpc_impl/request/DropTableRequest.cpp +++ b/core/src/server/grpc_impl/request/DropTableRequest.cpp @@ -40,7 +40,8 @@ DropTableRequest::Create(const std::string& table_name) { Status DropTableRequest::OnExecute() { try { - TimeRecorder rc("DropTableRequest"); + std::string hdr = "DropTableRequest(table=" + table_name_ + ")"; + TimeRecorder rc(hdr); // step 1: check arguments auto status = ValidationUtil::ValidateTableName(table_name_); diff --git a/core/src/server/grpc_impl/request/HasTableRequest.cpp b/core/src/server/grpc_impl/request/HasTableRequest.cpp index 2909c93056..434580efdf 100644 --- a/core/src/server/grpc_impl/request/HasTableRequest.cpp +++ b/core/src/server/grpc_impl/request/HasTableRequest.cpp @@ -39,7 +39,8 @@ HasTableRequest::Create(const std::string& table_name, bool& has_table) { Status HasTableRequest::OnExecute() { try { - TimeRecorder rc("HasTableRequest"); + std::string hdr = "HasTableRequest(table=" + table_name_ + ")"; + TimeRecorder rc(hdr); // step 1: check arguments auto status = ValidationUtil::ValidateTableName(table_name_); diff --git a/core/src/server/grpc_impl/request/InsertRequest.cpp b/core/src/server/grpc_impl/request/InsertRequest.cpp index 16d16ca8dc..df65c679ed 100644 --- a/core/src/server/grpc_impl/request/InsertRequest.cpp +++ b/core/src/server/grpc_impl/request/InsertRequest.cpp @@ -46,7 +46,8 @@ Status InsertRequest::OnExecute() { try { std::string hdr = "InsertRequest(table=" + insert_param_->table_name() + - ", n=" + std::to_string(insert_param_->row_record_array_size()) + ")"; + ", n=" + std::to_string(insert_param_->row_record_array_size()) + + ", partition_tag=" + insert_param_->partition_tag() + ")"; TimeRecorder rc(hdr); // step 1: check arguments diff --git a/core/src/server/grpc_impl/request/PreloadTableRequest.cpp b/core/src/server/grpc_impl/request/PreloadTableRequest.cpp index e26aa8a877..3c46524afe 100644 --- a/core/src/server/grpc_impl/request/PreloadTableRequest.cpp +++ b/core/src/server/grpc_impl/request/PreloadTableRequest.cpp @@ -39,7 +39,8 @@ PreloadTableRequest::Create(const std::string& table_name) { Status PreloadTableRequest::OnExecute() { try { - TimeRecorder rc("PreloadTableRequest"); + std::string hdr = "PreloadTableRequest(table=" + table_name_ + ")"; + TimeRecorder rc(hdr); // step 1: check arguments auto status = ValidationUtil::ValidateTableName(table_name_); diff --git a/core/src/server/grpc_impl/request/ShowPartitionsRequest.cpp b/core/src/server/grpc_impl/request/ShowPartitionsRequest.cpp index 32fa0672c5..0d0809b171 100644 --- a/core/src/server/grpc_impl/request/ShowPartitionsRequest.cpp +++ b/core/src/server/grpc_impl/request/ShowPartitionsRequest.cpp @@ -40,6 +40,9 @@ ShowPartitionsRequest::Create(const std::string& table_name, ::milvus::grpc::Par Status ShowPartitionsRequest::OnExecute() { + std::string hdr = "ShowPartitionsRequest(table=" + table_name_ + ")"; + TimeRecorder rc(hdr); + auto status = ValidationUtil::ValidateTableName(table_name_); if (!status.ok()) { return status; diff --git a/core/src/server/grpc_impl/request/ShowTablesRequest.cpp b/core/src/server/grpc_impl/request/ShowTablesRequest.cpp index 90dbad981f..404e08197e 100644 --- a/core/src/server/grpc_impl/request/ShowTablesRequest.cpp +++ b/core/src/server/grpc_impl/request/ShowTablesRequest.cpp @@ -38,6 +38,8 @@ ShowTablesRequest::Create(::milvus::grpc::TableNameList* table_name_list) { Status ShowTablesRequest::OnExecute() { + TimeRecorder rc("ShowTablesRequest"); + std::vector schema_array; auto statuts = DBWrapper::DB()->AllTables(schema_array); if (!statuts.ok()) {