From 7a1488319900b5dfdd24bf262da262237d4038ba Mon Sep 17 00:00:00 2001 From: zhao liwei Date: Mon, 11 Jan 2021 10:53:56 +0800 Subject: [PATCH] refactor: don't resend message if it is rejected by server (#722) --- src/client/partition_resolver.cpp | 2 +- src/common/duplication_common.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/partition_resolver.cpp b/src/client/partition_resolver.cpp index f59a33ae76..4d9b133fa9 100644 --- a/src/client/partition_resolver.cpp +++ b/src/client/partition_resolver.cpp @@ -53,7 +53,7 @@ void partition_resolver::call_task(const rpc_response_task_ptr &t) dsn::error_code err, dsn::message_ex * req, dsn::message_ex * resp) { if (req->header->gpid.value() != 0 && err != ERR_OK && err != ERR_HANDLER_NOT_FOUND && - err != ERR_APP_NOT_EXIST && err != ERR_OPERATION_DISABLED) { + err != ERR_APP_NOT_EXIST && err != ERR_OPERATION_DISABLED && err != ERR_BUSY) { on_access_failure(req->header->gpid.get_partition_index(), err); // still got time, retry uint64_t nms = dsn_now_ms(); diff --git a/src/common/duplication_common.cpp b/src/common/duplication_common.cpp index 56ee0eedd0..dce1ab61fd 100644 --- a/src/common/duplication_common.cpp +++ b/src/common/duplication_common.cpp @@ -30,9 +30,11 @@ #include #include #include +#include namespace dsn { namespace replication { +DSN_DEFINE_string("replication", cluster_name, "", "name of this cluster"); /*extern*/ const char *duplication_status_to_string(duplication_status::type status) { @@ -54,10 +56,8 @@ namespace replication { /*extern*/ const char *get_current_cluster_name() { - static const char *cluster_name = - dsn_config_get_value_string("replication", "cluster_name", "", "name of this cluster"); - dassert(strlen(cluster_name) != 0, "cluster_name is not set"); - return cluster_name; + dassert(strlen(FLAGS_cluster_name) != 0, "cluster_name is not set"); + return FLAGS_cluster_name; } namespace internal {