From 91021d27068d0d24b9906fe2046cb411d54f4981 Mon Sep 17 00:00:00 2001 From: KyrielightWei Date: Wed, 14 Aug 2024 02:47:11 +0000 Subject: [PATCH] restore tx ls state after switch_to_follower_gracefully failed --- src/storage/tx/ob_trans_ctx_mgr_v4.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/storage/tx/ob_trans_ctx_mgr_v4.cpp b/src/storage/tx/ob_trans_ctx_mgr_v4.cpp index 7f84fe754..8e8200223 100644 --- a/src/storage/tx/ob_trans_ctx_mgr_v4.cpp +++ b/src/storage/tx/ob_trans_ctx_mgr_v4.cpp @@ -889,9 +889,11 @@ int ObLSTxCtxMgr::switch_to_follower_gracefully() TRANS_LOG(WARN, "switch state error", KR(ret), K(ls_id_), K(tx_ls_state_mgr_)); } else if (OB_TMP_FAIL(submit_start_working_log_())) { TRANS_LOG(WARN, "submit start working log failed", KR(tmp_ret), K(*this)); - tx_ls_state_mgr_.restore_tx_ls_state(); } if (OB_SUCCESS != tmp_ret) { + //Use a processing method that is compatible with the old code, + //treating the situation as the on_failure of a start working log. + tx_ls_state_mgr_.switch_tx_ls_state(ObTxLSStateMgr::TxLSAction::SWL_CB_FAIL); ret = OB_LS_NEED_REVOKE; } TRANS_LOG(WARN, "switch to follower failed", KR(ret), KR(tmp_ret), K(*this));