From 4a847be5a79b8ee418501ff50bf77d39e6aff108 Mon Sep 17 00:00:00 2001 From: hiddenbomb Date: Fri, 11 Aug 2023 03:42:47 +0000 Subject: [PATCH] enhance validation for medium info read operation --- src/storage/ls/ob_ls_tablet_service.cpp | 48 ++++++------ .../meta_mem/ob_tenant_meta_mem_mgr.cpp | 6 +- .../tablet/ob_i_tablet_mds_interface.h | 2 +- src/storage/tablet/ob_tablet.cpp | 75 ++++++++++++++++--- src/storage/tablet/ob_tablet.h | 3 + src/storage/tablet/ob_tablet_mds_data.cpp | 2 +- .../ob_tablet_mds_node_dump_operator.cpp | 5 +- .../tablet/ob_tablet_mds_node_dump_operator.h | 2 + .../tx_storage/ob_empty_shell_task.cpp | 6 +- 9 files changed, 106 insertions(+), 43 deletions(-) diff --git a/src/storage/ls/ob_ls_tablet_service.cpp b/src/storage/ls/ob_ls_tablet_service.cpp index 93e44a80cc..bcc5aeb6ad 100755 --- a/src/storage/ls/ob_ls_tablet_service.cpp +++ b/src/storage/ls/ob_ls_tablet_service.cpp @@ -328,7 +328,7 @@ int ObLSTabletService::delete_all_tablets() ObSArray tablet_id_array; GetAllTabletIDOperator op(tablet_id_array); - ObTimeGuard time_guard("ObLSTabletService::delete_all_tablets", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::delete_all_tablets", 1_s); common::ObBucketWLockAllGuard lock_guard(bucket_lock_); time_guard.click("Lock"); if (OB_FAIL(tablet_id_set_.foreach(op))) { @@ -427,7 +427,7 @@ int ObLSTabletService::remove_tablets(const common::ObIArray if (OB_SUCC(ret)) { ObMetaDiskAddr tablet_addr; - ObTimeGuard time_guard("ObLSTabletService::remove_tablets", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::remove_tablets", 1_s); ObMultiBucketLockGuard lock_guard(bucket_lock_, true/*is_write_lock*/); if (OB_FAIL(lock_guard.lock_multi_buckets(all_tablet_id_hash_array))) { LOG_WARN("failed to lock multi buckets", K(ret)); @@ -497,7 +497,7 @@ int ObLSTabletService::remove_tablets(const common::ObIArray int ObLSTabletService::do_remove_tablet(const ObTabletMapKey &key) { int ret = OB_SUCCESS; - ObTimeGuard time_guard("RmTabletLock", 1000000/*1 seconds*/); + ObTimeGuard time_guard("RmTabletLock", 1_s); ObBucketHashWLockGuard lock_guard(bucket_lock_, key.tablet_id_.hash()); time_guard.click("Lock"); if (OB_FAIL(inner_remove_tablet(key.ls_id_, key.tablet_id_))) { @@ -723,7 +723,7 @@ int ObLSTabletService::trim_old_tablets(const ObTabletID &tablet_id) { int ret = OB_SUCCESS; ObTabletHandle tablet_handle_head; - ObTimeGuard time_guard("ObLSTabletService::trim_old_tablets", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::trim_old_tablets", 1_s); ObBucketHashWLockGuard lock_guard(bucket_lock_, tablet_id.hash()); time_guard.click("Lock"); @@ -769,7 +769,7 @@ int ObLSTabletService::rollback_rebuild_tablet(const ObTabletID &tablet_id) { int ret = OB_SUCCESS; ObTabletHandle tablet_handle_head; - ObTimeGuard time_guard("ObLSTabletService::rollback_rebuild_tablet", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::rollback_rebuild_tablet", 1_s); ObBucketHashWLockGuard lock_guard(bucket_lock_, tablet_id.hash()); time_guard.click("Lock"); @@ -818,7 +818,7 @@ int ObLSTabletService::rebuild_tablet_with_old( ObTabletHandle &tablet_guard) { int ret = OB_SUCCESS; - ObTimeGuard time_guard("ObLSTabletService::rebuild_tablet_with_old", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::rebuild_tablet_with_old", 1_s); common::ObArenaAllocator allocator("RebuildTablet"); ObTabletHandle old_tablet_hdl; ObTabletHandle tmp_tablet_hdl; @@ -868,7 +868,7 @@ int ObLSTabletService::migrate_update_tablet( const ObMigrationTabletParam &mig_tablet_param) { int ret = OB_SUCCESS; - ObTimeGuard time_guard("ObLSTabletService::migrate_update_tablet", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::migrate_update_tablet", 1_s); common::ObArenaAllocator allocator("MigUpTab"); const common::ObTabletID &tablet_id = mig_tablet_param.tablet_id_; const share::ObLSID &ls_id = mig_tablet_param.ls_id_; @@ -916,7 +916,7 @@ int ObLSTabletService::migrate_create_tablet( ObTabletHandle &handle) { int ret = OB_SUCCESS; - ObTimeGuard time_guard("ObLSTabletService::migrate_create_tablet", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::migrate_create_tablet", 1_s); common::ObArenaAllocator allocator("MigCreateTab"); const share::ObLSID &ls_id = mig_tablet_param.ls_id_; const common::ObTabletID &tablet_id = mig_tablet_param.tablet_id_; @@ -993,7 +993,7 @@ int ObLSTabletService::update_tablet_checkpoint( { int ret = OB_SUCCESS; - ObTimeGuard time_guard("UpdateTabletCKPT", 3000000/*3 seconds*/); + ObTimeGuard time_guard("UpdateTabletCKPT", 3_s); if (IS_NOT_INIT) { ret = OB_NOT_INIT; LOG_WARN("ls tablet svr hasn't been inited", K(ret)); @@ -1062,7 +1062,7 @@ int ObLSTabletService::update_tablet_table_store( ObTablet *old_tablet = old_tablet_handle.get_obj(); const common::ObTabletID &tablet_id = old_tablet->get_tablet_meta().tablet_id_; - ObTimeGuard time_guard("ObLSTabletService::ReplaceSSTable", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::ReplaceSSTable", 1_s); ObBucketHashWLockGuard lock_guard(bucket_lock_, tablet_id.hash()); time_guard.click("Lock"); @@ -1127,7 +1127,7 @@ int ObLSTabletService::update_tablet_table_store( ObTabletHandle old_tablet_hdl; ObTabletHandle tmp_tablet_hdl; ObTabletHandle new_tablet_hdl; - ObTimeGuard time_guard("ObLSTabletService::UpdateTableStore", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::UpdateTableStore", 1_s); if (IS_NOT_INIT) { ret = OB_NOT_INIT; @@ -1190,7 +1190,7 @@ int ObLSTabletService::update_tablet_mstx( ObTablet *new_tablet = nullptr; ObMetaDiskAddr new_addr; - ObTimeGuard time_guard("ObLSTabletService::update_tablet_mstx", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::update_tablet_mstx", 1_s); if (IS_NOT_INIT) { ret = OB_NOT_INIT; LOG_WARN("not inited", K(ret), K_(is_inited)); @@ -1252,7 +1252,7 @@ int ObLSTabletService::update_tablet_to_empty_shell(const common::ObTabletID &ta const share::ObLSID &ls_id = ls_->get_ls_id(); const ObTabletMapKey key(ls_id, tablet_id); ObTabletHandle new_tablet_hdl; - ObTimeGuard time_guard("UpdateTabletToEmptyShell", 3 * 1000 * 1000/*3 seconds*/); + ObTimeGuard time_guard("UpdateTabletToEmptyShell", 3_s); if (IS_NOT_INIT) { ret = OB_NOT_INIT; @@ -1299,7 +1299,7 @@ int ObLSTabletService::no_lock_update_tablet_to_empty_shell( int ret = OB_SUCCESS; ObTabletHandle old_tablet_handle; const common::ObTabletID &tablet_id = key.tablet_id_; - ObTimeGuard time_guard("NoLockUpdateTabletToEmptyShell", 2 * 1000 * 1000/*2 seconds*/); + ObTimeGuard time_guard("NoLockUpdateTabletToEmptyShell", 2_s); if (OB_FAIL(direct_get_tablet(tablet_id, old_tablet_handle))) { LOG_WARN("failed to get tablet", K(ret), K(tablet_id)); @@ -1339,7 +1339,7 @@ int ObLSTabletService::update_medium_compaction_info( int ret = OB_SUCCESS; common::ObArenaAllocator allocator; ObTabletHandle old_tablet_handle; - ObTimeGuard time_guard("ObLSTabletService::update_medium_compaction_info", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::update_medium_compaction_info", 1_s); ObBucketHashWLockGuard lock_guard(bucket_lock_, tablet_id.hash()); time_guard.click("Lock"); @@ -1403,7 +1403,7 @@ int ObLSTabletService::build_new_tablet_from_mds_table( ObTabletHandle old_tablet_handle; ObTabletHandle tmp_tablet_hdl; ObTabletHandle new_tablet_handle; - ObTimeGuard time_guard("MdsDump", 3 * 1000 * 1000/*3 seconds*/); + ObTimeGuard time_guard("MdsDump", 3_s); if (IS_NOT_INIT) { ret = OB_NOT_INIT; @@ -1467,7 +1467,7 @@ int ObLSTabletService::update_tablet_report_status(const common::ObTabletID &tab { int ret = OB_SUCCESS; ObTabletHandle tablet_handle; - ObTimeGuard time_guard("ObLSTabletService::update_tablet_report_status", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::update_tablet_report_status", 1_s); ObBucketHashWLockGuard lock_guard(bucket_lock_, tablet_id.hash()); time_guard.click("Lock"); @@ -1523,7 +1523,7 @@ int ObLSTabletService::update_tablet_restore_status( ObTabletRestoreStatus::STATUS current_status = ObTabletRestoreStatus::RESTORE_STATUS_MAX; bool can_change = false; - ObTimeGuard time_guard("ObLSTabletService::update_tablet_report_status", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::update_tablet_report_status", 1_s); ObBucketHashWLockGuard lock_guard(bucket_lock_, tablet_id.hash()); time_guard.click("Lock"); if (IS_NOT_INIT) { @@ -1596,7 +1596,7 @@ int ObLSTabletService::update_tablet_ha_data_status( ObTabletDataStatus::STATUS current_status = ObTabletDataStatus::DATA_STATUS_MAX; bool can_change = false; - ObTimeGuard time_guard("ObLSTabletService::update_tablet_ha_data_status", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::update_tablet_ha_data_status", 1_s); ObBucketHashWLockGuard lock_guard(bucket_lock_, tablet_id.hash()); time_guard.click("Lock"); if (IS_NOT_INIT) { @@ -1670,7 +1670,7 @@ int ObLSTabletService::update_tablet_ha_expected_status( ObTabletExpectedStatus::STATUS current_status = ObTabletExpectedStatus::EXPECTED_STATUS_MAX; bool can_change = false; - ObTimeGuard time_guard("ObLSTabletService::update_tablet_ha_data_status", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::update_tablet_ha_data_status", 1_s); ObBucketHashWLockGuard lock_guard(bucket_lock_, tablet_id.hash()); time_guard.click("Lock"); if (IS_NOT_INIT) { @@ -1759,7 +1759,7 @@ int ObLSTabletService::replay_create_tablet( ret = OB_ERR_UNEXPECTED; LOG_ERROR("restart replay tablet should not exist", K(ret), K(ls_id), K(tablet_id)); } else { - ObTimeGuard time_guard("ObLSTabletService::replay_create_tablet", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::replay_create_tablet", 1_s); common::ObArenaAllocator allocator("ReplayCreate"); const ObTabletMapKey key(ls_id, tablet_id); ObTabletHandle tablet_hdl; @@ -2125,7 +2125,7 @@ int ObLSTabletService::create_transfer_in_tablet( ObTabletHandle old_tablet_hdl; LOG_INFO("prepare to init transfer in tablet", K(ret), K(ls_id), K(tablet_meta)); - ObTimeGuard time_guard("CreateTransferIn", 3000000/*3 seconds*/); + ObTimeGuard time_guard("CreateTransferIn", 3_s); bool cover_empty_shell = false; if (!is_inited_) { @@ -2286,7 +2286,7 @@ int ObLSTabletService::create_memtable( ObTabletMemberWrapper table_store; ObTabletMemberWrapper autoinc_seq; - ObTimeGuard time_guard("ObLSTabletService::create_memtable", 10 * 1000); + ObTimeGuard time_guard("ObLSTabletService::create_memtable", 10_ms); if (OB_UNLIKELY(!is_inited_)) { ret = OB_NOT_INIT; LOG_WARN("not inited", K(ret), K_(is_inited)); @@ -3400,7 +3400,7 @@ int ObLSTabletService::build_ha_tablet_new_table_store( ObArenaAllocator allocator("BuildHaTab"); ObTenantMetaMemMgr *t3m = MTL(ObTenantMetaMemMgr*); ObMetaDiskAddr disk_addr; - ObTimeGuard time_guard("ObLSTabletService::build_ha_tablet_new_table_store", 1 * 1000 * 1000); + ObTimeGuard time_guard("ObLSTabletService::build_ha_tablet_new_table_store", 1_s); if (IS_NOT_INIT) { ret = OB_NOT_INIT; diff --git a/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp b/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp index fab639311f..26a6273960 100755 --- a/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp +++ b/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp @@ -1169,7 +1169,11 @@ void ObTenantMetaMemMgr::mark_mds_table_deleted_(const ObTabletMapKey &key) int ret = OB_SUCCESS; ObTabletPointerHandle ptr_handle(tablet_map_); if (OB_FAIL(tablet_map_.get(key, ptr_handle))) { - LOG_WARN_RET(OB_ERR_UNEXPECTED, "fail to get pointer from map", KR(ret), KPC(ptr_handle.get_resource_ptr())); + if (OB_ENTRY_NOT_EXIST == ret) { + // do nothing + } else { + LOG_WARN_RET(OB_ERR_UNEXPECTED, "fail to get pointer from map", KR(ret), "resource_ptr", ptr_handle.get_resource_ptr()); + } } else { if (OB_ISNULL(ptr_handle.get_resource_ptr())) { LOG_ERROR_RET(OB_ERR_UNEXPECTED, "ptr_handle is null", KPC(ptr_handle.get_resource_ptr())); diff --git a/src/storage/tablet/ob_i_tablet_mds_interface.h b/src/storage/tablet/ob_i_tablet_mds_interface.h index 1ecbf0458b..67dd7f68a8 100644 --- a/src/storage/tablet/ob_i_tablet_mds_interface.h +++ b/src/storage/tablet/ob_i_tablet_mds_interface.h @@ -42,7 +42,7 @@ public: int remove(const Key &key, mds::MdsCtx &ctx, const int64_t lock_timeout_us = 0); // sometimes mds ndoes needed be forcely released, e.g.: ls offline template - int forcely_reset_mds_table(const char (&reason)[N]);// reason must be cimpile-time str + int forcely_reset_mds_table(const char (&reason)[N]);// reason must be compile-time str template int is_locked_by_others(bool &is_locked, const mds::MdsWriter &self = mds::MdsWriter()) const; diff --git a/src/storage/tablet/ob_tablet.cpp b/src/storage/tablet/ob_tablet.cpp index 5b601b2b30..161d366f62 100755 --- a/src/storage/tablet/ob_tablet.cpp +++ b/src/storage/tablet/ob_tablet.cpp @@ -828,7 +828,14 @@ int ObTablet::read_medium_info_list( } else if (OB_FAIL(get_finish_medium_scn(finish_medium_scn))) { LOG_WARN("failed to get finish medium scn", K(ret)); } else if (OB_FAIL(read_mds_table_medium_info_list(allocator, mds_table_medium_info_list))) { - LOG_WARN("failed to read mds table medium info list", K(ret)); + if (OB_EMPTY_RESULT == ret) { + ret = OB_SUCCESS; + } else { + LOG_WARN("failed to read mds table medium info list", K(ret)); + } + } + + if (OB_FAIL(ret)) { } else if (OB_FAIL(ObTabletMdsData::load_medium_info_list(allocator, complex_addr, base_medium_info_list))) { LOG_WARN("failed to load medium info list", K(ret)); } else if (OB_FAIL(ObTabletMdsData::copy_medium_info_list(finish_medium_scn, *base_medium_info_list, fused_medium_info_list))) { @@ -5116,12 +5123,12 @@ int ObTablet::read_mds_table(common::ObIAllocator &allocator, ObTabletMdsData &m ret = OB_EMPTY_RESULT; LOG_INFO("mds table does not exist, may be released", K(ret), K(ls_id), K(tablet_id)); } else { - LOG_WARN("failed to get mds table", K(ret)); + LOG_WARN("failed to get mds table", K(ret), K(ls_id), K(tablet_id)); } } else { ObTabletDumpMdsNodeOperator op(mds_data, allocator); if (CLICK_FAIL(mds_table_handle.for_each_unit_from_small_key_to_big_from_old_node_to_new_to_dump(op, for_flush))) { - LOG_WARN("failed to traverse mds table", K(ret)); + LOG_WARN("failed to traverse mds table", K(ret), K(ls_id), K(tablet_id)); } else if (!op.dumped()) { ret = OB_EMPTY_RESULT; LOG_INFO("read nothing from mds table", K(ret), K(ls_id), K(tablet_id)); @@ -5135,22 +5142,29 @@ int ObTablet::read_mds_table_medium_info_list( common::ObIAllocator &allocator, ObTabletDumpedMediumInfo &medium_info_list) const { + TIMEGUARD_INIT(STORAGE, 10_ms, 5_s); int ret = OB_SUCCESS; + const share::ObLSID &ls_id = tablet_meta_.ls_id_; + const common::ObTabletID &tablet_id = tablet_meta_.tablet_id_; medium_info_list.reset(); mds::MdsTableHandle mds_table_handle; - if (OB_FAIL(inner_get_mds_table(mds_table_handle))) { - if (OB_ENTRY_NOT_EXIST == ret) { - ret = OB_SUCCESS; - } else { - LOG_WARN("failed to get mds table", K(ret)); - } - } else if (OB_FAIL(medium_info_list.init(allocator))) { + if (CLICK_FAIL(medium_info_list.init(allocator))) { LOG_WARN("failed to init medium info list", K(ret)); + } else if (CLICK_FAIL(inner_get_mds_table(mds_table_handle))) { + if (OB_ENTRY_NOT_EXIST == ret) { + ret = OB_EMPTY_RESULT; + LOG_INFO("mds table does not exist, may be released", K(ret), K(ls_id), K(tablet_id)); + } else { + LOG_WARN("failed to get mds table", K(ret), K(ls_id), K(tablet_id)); + } } else { ObTabletMediumInfoNodeOperator op(medium_info_list, allocator); - if (OB_FAIL(mds_table_handle.for_each_unit_from_small_key_to_big_from_old_node_to_new_to_dump(op, false/*for_flush*/))) { - LOG_WARN("failed to traverse mds table", K(ret)); + if (CLICK_FAIL(mds_table_handle.for_each_unit_from_small_key_to_big_from_old_node_to_new_to_dump(op, false/*for_flush*/))) { + LOG_WARN("failed to traverse mds table", K(ret), K(ls_id), K(tablet_id)); + } else if (!op.dumped()) { + ret = OB_EMPTY_RESULT; + LOG_INFO("read nothing from mds table", K(ret), K(ls_id), K(tablet_id)); } } @@ -5552,12 +5566,49 @@ int ObTablet::get_fused_medium_info_list( LOG_WARN("failed to get finish medium scn", K(ret)); } else if (OB_FAIL(new_mds_data.init(allocator, mds_table_data, mds_data_, finish_medium_scn))) { LOG_WARN("failed to init new mds data", K(ret), K(finish_medium_scn)); + } else if (OB_FAIL(validate_medium_info_list(finish_medium_scn, new_mds_data))) { + LOG_WARN("failed to validate medium info list", K(ret), K(finish_medium_scn)); } else if (OB_FAIL(mds_data.init(allocator, new_mds_data))) { LOG_WARN("failed to assign mds data", K(ret), K(new_mds_data), K(mds_data_), K(mds_table_data)); } return ret; } +int ObTablet::validate_medium_info_list( + const int64_t finish_medium_scn, + const ObTabletMdsData &mds_data) const +{ + int ret = OB_SUCCESS; + const share::ObLSID &ls_id = tablet_meta_.ls_id_; + const common::ObTabletID &tablet_id = tablet_meta_.tablet_id_; + const ObTabletDumpedMediumInfo *medium_info_list = mds_data.medium_info_list_.ptr_; + const ObExtraMediumInfo &extra_info = mds_data.extra_medium_info_; + + if (OB_ISNULL(medium_info_list)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("medium info list is null", K(ret), K(mds_data)); + } else if (OB_UNLIKELY(0 != extra_info.last_medium_scn_ && finish_medium_scn != extra_info.last_medium_scn_)) { + ret = OB_INVALID_DATA; + LOG_WARN("last medium scn does not equal to last major sstable snapshot version", K(ret), K(ls_id), K(tablet_id), + K(finish_medium_scn), K(extra_info)); + } else { + const common::ObIArray &array = medium_info_list->medium_info_list_; + if (!array.empty()) { + const compaction::ObMediumCompactionInfo *first_info = array.at(0); + if (OB_ISNULL(first_info)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("medium info is null", K(ret), K(ls_id), K(tablet_id), KP(first_info)); + } else if (OB_UNLIKELY(first_info->last_medium_snapshot_ != finish_medium_scn)) { + ret = OB_INVALID_DATA; + LOG_WARN("first medium info does not match last major sstable snapshot version", K(ret), K(ls_id), K(tablet_id), + K(finish_medium_scn), KPC(first_info)); + } + } + } + + return ret; +} + int ObTablet::convert_to_mds_dump_kv( common::ObIAllocator &allocator, const share::ObTabletAutoincSeq &auto_inc_seq, diff --git a/src/storage/tablet/ob_tablet.h b/src/storage/tablet/ob_tablet.h index a7e7b8f41d..fd043e1772 100755 --- a/src/storage/tablet/ob_tablet.h +++ b/src/storage/tablet/ob_tablet.h @@ -639,6 +639,9 @@ private: const ObTabletComplexAddr &complex_addr, const compaction::ObExtraMediumInfo &extra_info, compaction::ObMediumCompactionInfoList &medium_info_list); + int validate_medium_info_list( + const int64_t finish_medium_scn, + const ObTabletMdsData &mds_data) const; int set_initial_state(const bool initial_state); int load_deserialize_v1( diff --git a/src/storage/tablet/ob_tablet_mds_data.cpp b/src/storage/tablet/ob_tablet_mds_data.cpp index 849bedd326..ef7eba0f75 100644 --- a/src/storage/tablet/ob_tablet_mds_data.cpp +++ b/src/storage/tablet/ob_tablet_mds_data.cpp @@ -595,7 +595,7 @@ int ObTabletMdsData::init_medium_info_list( * finish_medium_scn = last_major->get_snapshot_version() * if finish_medium_scn < old_extra_medium_info.last_medium_scn_, means local extra_medium_info is invalid, * use input medium list to replace - */ + */ if (nullptr == old_medium_info_list || finish_medium_scn < old_extra_medium_info.last_medium_scn_ || old_extra_medium_info.last_medium_scn_ < full_memory_medium_info_list.extra_medium_info_.last_medium_scn_) { diff --git a/src/storage/tablet/ob_tablet_mds_node_dump_operator.cpp b/src/storage/tablet/ob_tablet_mds_node_dump_operator.cpp index b70c0ea4ba..33cedaae47 100644 --- a/src/storage/tablet/ob_tablet_mds_node_dump_operator.cpp +++ b/src/storage/tablet/ob_tablet_mds_node_dump_operator.cpp @@ -208,7 +208,8 @@ int ObTabletDumpMdsNodeOperator::operator()(const mds::MdsDumpKV &kv) ObTabletMediumInfoNodeOperator::ObTabletMediumInfoNodeOperator(ObTabletDumpedMediumInfo &medium_info_list, common::ObIAllocator &allocator) : medium_info_list_(medium_info_list), - allocator_(allocator) + allocator_(allocator), + dumped_(false) { } @@ -227,6 +228,8 @@ int ObTabletMediumInfoNodeOperator::operator()(const mds::MdsDumpKV &kv) LOG_WARN("invalid state", K(ret), K(state)); } else if (OB_FAIL(medium_info_list_.append(key, node))) { LOG_WARN("failed to copy mds dump node", K(ret)); + } else { + dumped_ = true; } } diff --git a/src/storage/tablet/ob_tablet_mds_node_dump_operator.h b/src/storage/tablet/ob_tablet_mds_node_dump_operator.h index 782f6e9b8e..382ec9fe10 100644 --- a/src/storage/tablet/ob_tablet_mds_node_dump_operator.h +++ b/src/storage/tablet/ob_tablet_mds_node_dump_operator.h @@ -52,9 +52,11 @@ public: ObTabletMediumInfoNodeOperator(ObTabletDumpedMediumInfo &medium_info_list, common::ObIAllocator &allocator); public: int operator()(const mds::MdsDumpKV &kv); + bool dumped() const { return dumped_; } private: ObTabletDumpedMediumInfo &medium_info_list_; common::ObIAllocator &allocator_; + bool dumped_; }; } // namespace storage } // namespace oceanbase diff --git a/src/storage/tx_storage/ob_empty_shell_task.cpp b/src/storage/tx_storage/ob_empty_shell_task.cpp index 76c2deee3b..8ac95b7889 100644 --- a/src/storage/tx_storage/ob_empty_shell_task.cpp +++ b/src/storage/tx_storage/ob_empty_shell_task.cpp @@ -165,7 +165,7 @@ int ObTabletEmptyShellHandler::get_empty_shell_tablet_ids(common::ObTabletIDArra } else if (OB_FAIL(check_can_become_empty_shell_(*tablet, can_become_shell, need_retry))) { STORAGE_LOG(WARN, "check tablet can become empty shell failed", KR(ret), KPC(tablet)); } else if (!can_become_shell) { - STORAGE_LOG(INFO, "table can not become shell", KR(ret), "tablet_meta", tablet->get_tablet_meta()); + STORAGE_LOG(INFO, "tablet can not become shell", KR(ret), "tablet_meta", tablet->get_tablet_meta()); } else if (OB_FAIL(empty_shell_tablet_ids.push_back(tablet->get_tablet_meta().tablet_id_))) { STORAGE_LOG(WARN, "update tablet to empty shell failed", KR(ret),"tablet_meta", tablet->get_tablet_meta()); } @@ -242,7 +242,7 @@ int ObTabletEmptyShellHandler::check_can_become_empty_shell_(const ObTablet &tab } else if (MTL_IS_PRIMARY_TENANT() && OB_FAIL(check_tablet_empty_shell_for_primary_(tablet, user_data, can, need_retry))) { STORAGE_LOG(WARN, "failed to check tablet can become empty shell for primary", K(ret), "ls_id", ls_->get_ls_id(), K(tablet_id)); } else if (!MTL_IS_PRIMARY_TENANT() && OB_FAIL(check_tablet_empty_shell_for_standby_(tablet, user_data, can, need_retry))) { - STORAGE_LOG(WARN, "failed to update tablet to shell", K(ret), "ls_id", ls_->get_ls_id(), K(tablet_id)); + STORAGE_LOG(WARN, "failed to check tablet can become empty shell for standby", K(ret), "ls_id", ls_->get_ls_id(), K(tablet_id)); } return ret; } @@ -284,7 +284,7 @@ int ObTabletEmptyShellHandler::check_tablet_empty_shell_for_standby_( need_retry = true; if (REACH_TENANT_TIME_INTERVAL(1 * 1000 * 1000/*1s*/)) { STORAGE_LOG(INFO, "readable_scn is smaller than finish_scn", - "ls_id", ls_->get_ls_id(), K(tablet_id), K(info), K(user_data)); + "ls_id", ls_->get_ls_id(), K(tablet_id), K(readable_scn), K(user_data), KPC(info)); } } }