From 3340486d7aed5e6fb39607a452c3364f34e22e75 Mon Sep 17 00:00:00 2001 From: obdev Date: Fri, 16 Jun 2023 04:42:23 +0000 Subject: [PATCH] reset return code to TIMEOUT, to prevent the error code which not user unfriendly --- src/share/ob_primary_standby_service.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/share/ob_primary_standby_service.cpp b/src/share/ob_primary_standby_service.cpp index a386fa03fe..7bdb834bae 100644 --- a/src/share/ob_primary_standby_service.cpp +++ b/src/share/ob_primary_standby_service.cpp @@ -138,6 +138,11 @@ int ObPrimaryStandbyService::switch_tenant(const obrpc::ObSwitchTenantArg &arg) LOG_USER_ERROR(OB_OP_NOT_ALLOW, "tenant status is not normal, switch tenant is"); } + // reset return code to TIMEOUT, to prevent the error code which not user unfriendly + if (THIS_WORKER.is_timeout() && OB_ERR_EXCLUSIVE_LOCK_CONFLICT == ret) { + ret = OB_TIMEOUT; + } + int64_t cost = ObTimeUtility::current_time() - begin_time; CLUSTER_EVENT_ADD_CONTROL_FINISH(ret, alter_cluster_event, K(cost),