diff --git a/src/clients/meta/MetaClient.cpp b/src/clients/meta/MetaClient.cpp index 75979fb1a10..1cec0afe970 100644 --- a/src/clients/meta/MetaClient.cpp +++ b/src/clients/meta/MetaClient.cpp @@ -821,7 +821,7 @@ Status MetaClient::handleResponse(const RESP& resp) { case nebula::cpp2::ErrorCode::E_FAIL_TO_CONNECT: return Status::Error("Fail to connect!"); case nebula::cpp2::ErrorCode::E_RPC_FAILURE: - return Status::Error("Rpc failure!"); + return Status::Error("Rpc failure, probably timeout!"); case nebula::cpp2::ErrorCode::E_LEADER_CHANGED: return Status::LeaderChanged("Leader changed!"); case nebula::cpp2::ErrorCode::E_NO_HOSTS: @@ -868,8 +868,6 @@ Status MetaClient::handleResponse(const RESP& resp) { return Status::Error("The balancer is running!"); case nebula::cpp2::ErrorCode::E_CONFIG_IMMUTABLE: return Status::Error("Config immutable!"); - case nebula::cpp2::ErrorCode::E_CONFLICT: - return Status::Error("Conflict!"); case nebula::cpp2::ErrorCode::E_INVALID_PARM: return Status::Error("Invalid param!"); case nebula::cpp2::ErrorCode::E_WRONGCLUSTER: @@ -965,6 +963,8 @@ Status MetaClient::handleResponse(const RESP& resp) { return Status::Error("Related index exists, please drop index first"); case nebula::cpp2::ErrorCode::E_RELATED_SPACE_EXISTS: return Status::Error("There are still space on the host"); + case nebula::cpp2::ErrorCode::E_RELATED_FULLTEXT_INDEX_EXISTS: + return Status::Error("Related fulltext index exists, please drop it first"); default: return Status::Error("Unknown error!"); } diff --git a/src/clients/storage/StorageClientBase-inl.h b/src/clients/storage/StorageClientBase-inl.h index 9a4e25d7eae..b041c21bc57 100644 --- a/src/clients/storage/StorageClientBase-inl.h +++ b/src/clients/storage/StorageClientBase-inl.h @@ -205,7 +205,7 @@ folly::Future> StorageClientBasewhat(); } - return Status::Error("RPC failure in StorageClient: %s", ex->what()); + return Status::Error("RPC failure in StorageClient, probably timeout: %s", ex->what()); }); } diff --git a/src/graph/executor/StorageAccessExecutor.h b/src/graph/executor/StorageAccessExecutor.h index b6323531131..fbd69b14b37 100644 --- a/src/graph/executor/StorageAccessExecutor.h +++ b/src/graph/executor/StorageAccessExecutor.h @@ -56,6 +56,8 @@ class StorageAccessExecutor : public Executor { Status handleErrorCode(nebula::cpp2::ErrorCode code, PartitionID partId) const { switch (code) { + case nebula::cpp2::ErrorCode::E_RPC_FAILURE: + return Status::Error("Storage Error: RPC failure, probably timeout."); case nebula::cpp2::ErrorCode::E_KEY_NOT_FOUND: return Status::Error("Storage Error: Vertex or edge not found."); case nebula::cpp2::ErrorCode::E_DATA_TYPE_MISMATCH: { diff --git a/src/interface/common.thrift b/src/interface/common.thrift index 9d00fd57475..e70a69c9a6d 100644 --- a/src/interface/common.thrift +++ b/src/interface/common.thrift @@ -364,6 +364,7 @@ enum ErrorCode { E_SCHEMA_NAME_EXISTS = -2013, // Schema name already exists E_RELATED_INDEX_EXISTS = -2014, // There are still indexes related to tag or edge, cannot drop it E_RELATED_SPACE_EXISTS = -2015, // There are still some space on the host, cannot drop it + E_RELATED_FULLTEXT_INDEX_EXISTS = -2016, // There are still fulltext index on tag/edge E_STORE_FAILURE = -2021, // Failed to store data E_STORE_SEGMENT_ILLEGAL = -2022, // Illegal storage segment diff --git a/src/meta/processors/BaseProcessor-inl.h b/src/meta/processors/BaseProcessor-inl.h index 8a6e9961b0a..0a1f3fde65f 100644 --- a/src/meta/processors/BaseProcessor-inl.h +++ b/src/meta/processors/BaseProcessor-inl.h @@ -453,7 +453,7 @@ nebula::cpp2::ErrorCode BaseProcessor::indexCheck( if (it != indexCols.end()) { LOG(INFO) << "Index conflict, index :" << index.get_index_name() << ", column : " << tCol.name; - return nebula::cpp2::ErrorCode::E_CONFLICT; + return nebula::cpp2::ErrorCode::E_RELATED_INDEX_EXISTS; } } } @@ -474,7 +474,7 @@ nebula::cpp2::ErrorCode BaseProcessor::ftIndexCheck( std::find_if(cols.begin(), cols.end(), [&](const auto& c) { return c == iCol.name; }); if (it != cols.end()) { LOG(INFO) << "fulltext index conflict"; - return nebula::cpp2::ErrorCode::E_CONFLICT; + return nebula::cpp2::ErrorCode::E_RELATED_FULLTEXT_INDEX_EXISTS; } } } diff --git a/src/meta/processors/BaseProcessor.h b/src/meta/processors/BaseProcessor.h index 56c452c3d47..127520f4fe0 100644 --- a/src/meta/processors/BaseProcessor.h +++ b/src/meta/processors/BaseProcessor.h @@ -339,7 +339,7 @@ class BaseProcessor { * @tparam RESP * @param items * @param alterItems - * @return ErrorCode::E_CONFLICT if contains + * @return ErrorCode::E_RELATED_INDEX_EXISTS if contains */ nebula::cpp2::ErrorCode indexCheck(const std::vector& items, const std::vector& alterItems); @@ -350,7 +350,7 @@ class BaseProcessor { * @tparam RESP * @param cols * @param alterItems - * @return nebula::cpp2::ErrorCode + * @return ErrorCode::E_RELATED_FULLTEXT_INDEX_EXISTS if contains */ nebula::cpp2::ErrorCode ftIndexCheck(const std::vector& cols, const std::vector& alterItems); diff --git a/src/meta/processors/index/CreateEdgeIndexProcessor.cpp b/src/meta/processors/index/CreateEdgeIndexProcessor.cpp index 85928287333..c431b7e88b3 100644 --- a/src/meta/processors/index/CreateEdgeIndexProcessor.cpp +++ b/src/meta/processors/index/CreateEdgeIndexProcessor.cpp @@ -24,7 +24,7 @@ void CreateEdgeIndexProcessor::process(const cpp2::CreateEdgeIndexReq& req) { } if (fields.size() != columnSet.size()) { LOG(INFO) << "Conflict field in the edge index."; - handleErrorCode(nebula::cpp2::ErrorCode::E_CONFLICT); + handleErrorCode(nebula::cpp2::ErrorCode::E_INVALID_PARM); onFinished(); return; } @@ -32,7 +32,7 @@ void CreateEdgeIndexProcessor::process(const cpp2::CreateEdgeIndexReq& req) { // A maximum of 16 columns are allowed in the index if (columnSet.size() > maxIndexLimit) { LOG(INFO) << "The number of index columns exceeds maximum limit " << maxIndexLimit; - handleErrorCode(nebula::cpp2::ErrorCode::E_CONFLICT); + handleErrorCode(nebula::cpp2::ErrorCode::E_INVALID_PARM); onFinished(); return; } diff --git a/src/meta/processors/index/CreateTagIndexProcessor.cpp b/src/meta/processors/index/CreateTagIndexProcessor.cpp index 23ee267c09c..f3267effbe1 100644 --- a/src/meta/processors/index/CreateTagIndexProcessor.cpp +++ b/src/meta/processors/index/CreateTagIndexProcessor.cpp @@ -24,7 +24,7 @@ void CreateTagIndexProcessor::process(const cpp2::CreateTagIndexReq& req) { } if (fields.size() != columnSet.size()) { LOG(INFO) << "Conflict field in the tag index."; - handleErrorCode(nebula::cpp2::ErrorCode::E_CONFLICT); + handleErrorCode(nebula::cpp2::ErrorCode::E_INVALID_PARM); onFinished(); return; } @@ -32,7 +32,7 @@ void CreateTagIndexProcessor::process(const cpp2::CreateTagIndexReq& req) { // A maximum of 16 columns are allowed in the index. if (columnSet.size() > maxIndexLimit) { LOG(INFO) << "The number of index columns exceeds maximum limit " << maxIndexLimit; - handleErrorCode(nebula::cpp2::ErrorCode::E_CONFLICT); + handleErrorCode(nebula::cpp2::ErrorCode::E_INVALID_PARM); onFinished(); return; } diff --git a/src/meta/processors/schema/CreateTagProcessor.cpp b/src/meta/processors/schema/CreateTagProcessor.cpp index f17cfae215c..adb9db5e538 100644 --- a/src/meta/processors/schema/CreateTagProcessor.cpp +++ b/src/meta/processors/schema/CreateTagProcessor.cpp @@ -22,7 +22,7 @@ void CreateTagProcessor::process(const cpp2::CreateTagReq& req) { LOG(INFO) << "Failed to create tag `" << tagName << "': some edge with the same name already exists."; resp_.id_ref() = to(nebula::value(conflictRet), EntryType::TAG); - handleErrorCode(nebula::cpp2::ErrorCode::E_CONFLICT); + handleErrorCode(nebula::cpp2::ErrorCode::E_SCHEMA_NAME_EXISTS); onFinished(); return; } else { diff --git a/src/meta/test/IndexProcessorTest.cpp b/src/meta/test/IndexProcessorTest.cpp index 327a1da9cfc..1f5ffb11514 100644 --- a/src/meta/test/IndexProcessorTest.cpp +++ b/src/meta/test/IndexProcessorTest.cpp @@ -301,7 +301,7 @@ TEST(IndexProcessorTest, TagIndexTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_INVALID_PARM, resp.get_code()); } { cpp2::CreateTagIndexReq req; @@ -665,7 +665,7 @@ TEST(IndexProcessorTest, EdgeIndexTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_INVALID_PARM, resp.get_code()); } { cpp2::CreateEdgeIndexReq req; @@ -834,7 +834,7 @@ TEST(IndexProcessorTest, EdgeIndexTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_INVALID_PARM, resp.get_code()); } { cpp2::CreateEdgeIndexReq req; @@ -846,7 +846,7 @@ TEST(IndexProcessorTest, EdgeIndexTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_INVALID_PARM, resp.get_code()); } } @@ -1001,7 +1001,7 @@ TEST(IndexProcessorTest, IndexCheckAlterEdgeTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_RELATED_INDEX_EXISTS, resp.get_code()); } // Verify ErrorCode of drop { @@ -1024,7 +1024,7 @@ TEST(IndexProcessorTest, IndexCheckAlterEdgeTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_RELATED_INDEX_EXISTS, resp.get_code()); } } @@ -1128,7 +1128,7 @@ TEST(IndexProcessorTest, IndexCheckAlterTagTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_RELATED_INDEX_EXISTS, resp.get_code()); } { cpp2::AlterTagReq req; @@ -1149,7 +1149,7 @@ TEST(IndexProcessorTest, IndexCheckAlterTagTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_RELATED_INDEX_EXISTS, resp.get_code()); } } @@ -1997,7 +1997,7 @@ TEST(IndexProcessorTest, AlterWithFTIndexTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_RELATED_FULLTEXT_INDEX_EXISTS, resp.get_code()); } { cpp2::AlterTagReq req; @@ -2018,7 +2018,7 @@ TEST(IndexProcessorTest, AlterWithFTIndexTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_RELATED_FULLTEXT_INDEX_EXISTS, resp.get_code()); } { cpp2::AlterTagReq req; @@ -2060,7 +2060,7 @@ TEST(IndexProcessorTest, AlterWithFTIndexTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_RELATED_FULLTEXT_INDEX_EXISTS, resp.get_code()); } { cpp2::AlterEdgeReq req; @@ -2081,7 +2081,7 @@ TEST(IndexProcessorTest, AlterWithFTIndexTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_RELATED_FULLTEXT_INDEX_EXISTS, resp.get_code()); } { cpp2::AlterEdgeReq req; diff --git a/src/meta/test/ProcessorTest.cpp b/src/meta/test/ProcessorTest.cpp index 66299126eb2..1b510745f43 100644 --- a/src/meta/test/ProcessorTest.cpp +++ b/src/meta/test/ProcessorTest.cpp @@ -848,7 +848,7 @@ TEST(ProcessorTest, CreateEdgeTest) { auto f = processor->getFuture(); processor->process(req); auto resp = std::move(f).get(); - ASSERT_EQ(nebula::cpp2::ErrorCode::E_CONFLICT, resp.get_code()); + ASSERT_EQ(nebula::cpp2::ErrorCode::E_SCHEMA_NAME_EXISTS, resp.get_code()); } // Set schema ttl property diff --git a/src/tools/db-dump/CMakeLists.txt b/src/tools/db-dump/CMakeLists.txt index 3ea1f5e06d8..ccbcd63bf80 100644 --- a/src/tools/db-dump/CMakeLists.txt +++ b/src/tools/db-dump/CMakeLists.txt @@ -18,15 +18,15 @@ nebula_add_executable( curl ) -install( - TARGETS - db_dump - PERMISSIONS - OWNER_EXECUTE OWNER_WRITE OWNER_READ - GROUP_EXECUTE GROUP_READ - WORLD_EXECUTE WORLD_READ - DESTINATION - bin - COMPONENT - tool -) +#install( +# TARGETS +# db_dump +# PERMISSIONS +# OWNER_EXECUTE OWNER_WRITE OWNER_READ +# GROUP_EXECUTE GROUP_READ +# WORLD_EXECUTE WORLD_READ +# DESTINATION +# bin +# COMPONENT +# tool +#)