From 6198cd2772fdea217fca80b1568aa094702db921 Mon Sep 17 00:00:00 2001 From: obdev Date: Tue, 24 Oct 2023 10:44:07 +0000 Subject: [PATCH] Fix case:2004_start_wait_relay_to_start_scn_trans_timeout_switch_leader remain problems --- src/storage/high_availability/ob_storage_ha_utils.cpp | 6 +----- src/storage/high_availability/ob_storage_ha_utils.h | 2 +- src/storage/high_availability/ob_transfer_handler.cpp | 10 +++++++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/storage/high_availability/ob_storage_ha_utils.cpp b/src/storage/high_availability/ob_storage_ha_utils.cpp index 63cbe2b9c..c2f2bfacd 100644 --- a/src/storage/high_availability/ob_storage_ha_utils.cpp +++ b/src/storage/high_availability/ob_storage_ha_utils.cpp @@ -343,7 +343,7 @@ int ObStorageHAUtils::check_disk_space() return ret; } -bool ObTransferUtils::is_need_retry_error(const int err, int64_t &retry_count) +bool ObTransferUtils::is_need_retry_error(const int err) { bool bool_ret = false; //white list @@ -355,10 +355,6 @@ bool ObTransferUtils::is_need_retry_error(const int err, int64_t &retry_count) case OB_TRANS_TIMEOUT: case OB_TIMEOUT: case OB_EAGAIN: - bool_ret = true; - retry_count++; - break; - // Only retry without add retry count case OB_ERR_EXCLUSIVE_LOCK_CONFLICT: bool_ret = true; break; diff --git a/src/storage/high_availability/ob_storage_ha_utils.h b/src/storage/high_availability/ob_storage_ha_utils.h index 8d26a5946..9ed6cc584 100644 --- a/src/storage/high_availability/ob_storage_ha_utils.h +++ b/src/storage/high_availability/ob_storage_ha_utils.h @@ -59,7 +59,7 @@ private: struct ObTransferUtils { - static bool is_need_retry_error(const int err, int64_t &retry_count); + static bool is_need_retry_error(const int err); static int block_tx(const uint64_t tenant_id, const share::ObLSID &ls_id, const share::SCN >s_scn); static int kill_tx(const uint64_t tenant_id, const share::ObLSID &ls_id, const share::SCN >s_scn); static int unblock_tx(const uint64_t tenant_id, const share::ObLSID &ls_id, const share::SCN >s_scn); diff --git a/src/storage/high_availability/ob_transfer_handler.cpp b/src/storage/high_availability/ob_transfer_handler.cpp index 88c84a6d4..ad3d9488f 100644 --- a/src/storage/high_availability/ob_transfer_handler.cpp +++ b/src/storage/high_availability/ob_transfer_handler.cpp @@ -1778,9 +1778,8 @@ bool ObTransferHandler::can_retry_( bool_ret = true; retry_count_++; } else if (ObTransferStatus::START == task_info.status_) { - int64_t tmp_retry_count = retry_count_; - if (ObTransferUtils::is_need_retry_error(result, tmp_retry_count) && retry_count_ < max_transfer_start_retry_count) { - retry_count_ = tmp_retry_count; + if (ObTransferUtils::is_need_retry_error(result) && retry_count_ < max_transfer_start_retry_count) { + retry_count_++; bool_ret = true; } else { bool_ret = false; @@ -2222,6 +2221,11 @@ int ObTransferHandler::check_config_version_( return ret; } +// Only src ls could work when task status is START or ABORT. +// Conversely dest ls work when task status is DOING. +// The benefit of above is that the src ls leader can make controlling medium compaction a local execution, +// which is more controllable. +// The ABORT status will change to FAILED status in src ls work time. int ObTransferHandler::check_task_exist_( const ObTransferStatus &status, const bool find_by_src_ls, bool &task_exist) const {