From dffbde1998d18f1ca4a1f2018c6410766bfca19b Mon Sep 17 00:00:00 2001 From: skylhd Date: Mon, 21 Oct 2024 08:16:53 +0000 Subject: [PATCH] [BUGFIX] add check tenant is dropped when ls not exist in lob retry --- src/storage/lob/ob_lob_retry.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/storage/lob/ob_lob_retry.cpp b/src/storage/lob/ob_lob_retry.cpp index 8d61b15d6..61481d111 100644 --- a/src/storage/lob/ob_lob_retry.cpp +++ b/src/storage/lob/ob_lob_retry.cpp @@ -41,17 +41,31 @@ int ObLobRetryUtil::check_need_retry(ObLobAccessParam ¶m, const int error_co ret = OB_KILLED_BY_THROTTLING; LOG_INFO("[LOB RETRY] Retry is interrupted by worker check wait", K(ret), KR(ret), K(error_code), KR(error_code), K(retry_cnt), K(need_retry)); } else { + need_retry = true; switch (error_code) { + case OB_LS_NOT_EXIST: { // check if tenant has been dropped when ls not exist + int tmp_ret = OB_SUCCESS; + bool is_dropped = false; + schema::ObMultiVersionSchemaService *schema_service = GCTX.schema_service_; + if (OB_ISNULL(schema_service)) { + tmp_ret = OB_ERR_UNEXPECTED; + LOG_WARN("schema_service is nullptr", "tmp_ret", tmp_ret); + } else if (OB_SUCCESS != (tmp_ret = schema_service->check_if_tenant_has_been_dropped(param.tenant_id_, is_dropped))) { + LOG_WARN("check if tenant has been dropped fail", "tmp_ret", tmp_ret); + } else if (is_dropped) { + ret = OB_TENANT_HAS_BEEN_DROPPED; + need_retry = false; + } // no need break + } case OB_REPLICA_NOT_READABLE: case OB_RPC_CONNECT_ERROR: case OB_RPC_SEND_ERROR: case OB_RPC_POST_ERROR: case OB_NOT_MASTER: case OB_NO_READABLE_REPLICA: - case OB_TABLET_NOT_EXIST: - case OB_LS_NOT_EXIST: { - need_retry = true; - if (OB_FAIL(ObLobLocationUtil::lob_refresh_location(param, error_code, retry_cnt))) { + case OB_TABLET_NOT_EXIST: { + if (!need_retry) { + } else if (OB_FAIL(ObLobLocationUtil::lob_refresh_location(param, error_code, retry_cnt))) { LOG_WARN("fail to do refresh location", K(ret), K(error_code), K(retry_cnt), K(param)); need_retry = false; }