From a0632e0b873ceec9ffdabb857fd59da10f79e83f Mon Sep 17 00:00:00 2001 From: a1iive Date: Mon, 13 Nov 2023 03:12:42 +0000 Subject: [PATCH] fix bugs about medium checker --- src/storage/compaction/ob_medium_compaction_func.cpp | 2 +- src/storage/compaction/ob_tenant_medium_checker.cpp | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/storage/compaction/ob_medium_compaction_func.cpp b/src/storage/compaction/ob_medium_compaction_func.cpp index f072d7da8..09c982ae2 100644 --- a/src/storage/compaction/ob_medium_compaction_func.cpp +++ b/src/storage/compaction/ob_medium_compaction_func.cpp @@ -986,7 +986,7 @@ int ObMediumCompactionScheduleFunc::batch_check_medium_meta_table( const ObTabletInfo &tablet_info = tablet_infos.at(i); const ObLSID &ls_id = tablet_info.get_ls_id(); const ObTabletID &tablet_id = tablet_info.get_tablet_id(); - const int64_t check_medium_scn = tablet_ls_infos.at(i).get_medium_scn(); + const int64_t check_medium_scn = tablet_ls_info.get_medium_scn(); if (tablet_ls_info.get_ls_id() != ls_id || tablet_ls_info.get_tablet_id() != tablet_id) { LOG_INFO("tablet_ls_info has been deleted", K(tablet_ls_info), K(tablet_info)); diff --git a/src/storage/compaction/ob_tenant_medium_checker.cpp b/src/storage/compaction/ob_tenant_medium_checker.cpp index 12ab7885f..8fa3fbdec 100644 --- a/src/storage/compaction/ob_tenant_medium_checker.cpp +++ b/src/storage/compaction/ob_tenant_medium_checker.cpp @@ -196,12 +196,8 @@ int ObTenantMediumChecker::add_tablet_ls(const ObTabletID &tablet_id, const shar LOG_WARN("fail to check ls status", K(ret), K(ls_id)); } else if (is_leader) { lib::ObMutexGuard guard(lock_); - if (OB_HASH_EXIST == (tmp_ret = tablet_ls_set_.exist_refactored(ObTabletCheckInfo(tablet_id, ls_id, medium_scn)))) { - ret = OB_SUCCESS; // tablet exist - } else if (OB_UNLIKELY(OB_HASH_NOT_EXIST != tmp_ret)) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("failed to check exist in tablet set", K(ret), K(tmp_ret), K(ls_id), K(tablet_id)); - } else if (OB_FAIL(tablet_ls_set_.set_refactored(ObTabletCheckInfo(tablet_id, ls_id, medium_scn)))) { + // just cover the old info + if (OB_FAIL(tablet_ls_set_.set_refactored(ObTabletCheckInfo(tablet_id, ls_id, medium_scn)))) { LOG_WARN("failed to set tablet_ls_info", K(ret), K(ls_id), K(tablet_id)); } }