diff --git a/src/storage/blocksstable/ob_block_manager.cpp b/src/storage/blocksstable/ob_block_manager.cpp index bf2e00a4b6..a1de31296d 100644 --- a/src/storage/blocksstable/ob_block_manager.cpp +++ b/src/storage/blocksstable/ob_block_manager.cpp @@ -775,7 +775,7 @@ int ObBlockManager::dec_disk_ref(const MacroBlockId ¯o_id) return ret; } -int ObBlockManager::update_write_time(const MacroBlockId ¯o_id) +int ObBlockManager::update_write_time(const MacroBlockId ¯o_id, const bool update_to_max_time) { int ret = OB_SUCCESS; BlockInfo block_info; @@ -790,7 +790,7 @@ int ObBlockManager::update_write_time(const MacroBlockId ¯o_id) if (OB_FAIL(block_map_.get(macro_id, block_info))) { LOG_WARN("get block_info fail", K(ret), K(macro_id)); } else { - block_info.last_write_time_ = ObTimeUtility::fast_current_time(); + block_info.last_write_time_ = update_to_max_time ? INT64_MAX : ObTimeUtility::fast_current_time(); if (OB_FAIL(block_map_.insert_or_update(macro_id, block_info))) { LOG_WARN("update block info fail", K(ret), K(macro_id), K(block_info)); } diff --git a/src/storage/blocksstable/ob_block_manager.h b/src/storage/blocksstable/ob_block_manager.h index f091b7e02a..d427ca7d41 100644 --- a/src/storage/blocksstable/ob_block_manager.h +++ b/src/storage/blocksstable/ob_block_manager.h @@ -215,7 +215,9 @@ public: int dec_ref(const MacroBlockId ¯o_id); int inc_disk_ref(const MacroBlockId ¯o_id); int dec_disk_ref(const MacroBlockId ¯o_id); - int update_write_time(const MacroBlockId ¯o_id); + // If update_to_max_time is true, it means modify the last_write_time_ of the block to max, + // which is used to skip the bad block inspection. + int update_write_time(const MacroBlockId ¯o_id, const bool update_to_max_time = false); // mark and sweep int get_marker_status(ObMacroBlockMarkerStatus &status); diff --git a/src/storage/blocksstable/ob_tmp_file_cache.cpp b/src/storage/blocksstable/ob_tmp_file_cache.cpp index 93b15a2a6c..4aec4a47a6 100644 --- a/src/storage/blocksstable/ob_tmp_file_cache.cpp +++ b/src/storage/blocksstable/ob_tmp_file_cache.cpp @@ -1211,6 +1211,9 @@ int ObTmpTenantMemBlockManager::write_io( STORAGE_LOG(WARN, "Fail to async write block", K(ret), K(write_info), K(handle)); } else if (OB_FAIL(block_write_ctx_.add_macro_block_id(handle.get_macro_id()))) { STORAGE_LOG(WARN, "fail to add macro id", K(ret), "macro id", handle.get_macro_id()); + } else if (OB_FAIL(OB_SERVER_BLOCK_MGR.update_write_time(handle.get_macro_id(), + true/*update_to_max_time*/))) { //just to skip bad block inspect + STORAGE_LOG(WARN, "fail to update macro id write time", K(ret), "macro id", handle.get_macro_id()); } } return ret; diff --git a/src/storage/meta_mem/ob_meta_obj_struct.h b/src/storage/meta_mem/ob_meta_obj_struct.h index ced2923648..ca80c0fe04 100644 --- a/src/storage/meta_mem/ob_meta_obj_struct.h +++ b/src/storage/meta_mem/ob_meta_obj_struct.h @@ -305,7 +305,7 @@ void ObMetaObjGuard::reset_obj() if (OB_UNLIKELY(hold_time > HOLD_OBJ_MAX_TIME && need_hold_time_check())) { int ret = OB_ERR_TOO_MUCH_TIME; STORAGE_LOG(WARN, "The meta obj reference count was held for more " - "than two hours ", K(ref_cnt), KP(this), K(hold_time), K(hold_start_time_), KPC(this)); + "than two hours ", K(ref_cnt), KP(this), K(hold_time), K(hold_start_time_), KPC(this), K(common::lbt())); } if (0 == ref_cnt) { if (nullptr != obj_pool_) { 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 1953208cc1..04191c3ca9 100644 --- a/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp +++ b/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp @@ -1871,6 +1871,8 @@ int ObTenantTabletPtrWithInMemObjIterator::get_next_tablet_pointer( if (OB_ENTRY_NOT_EXIST != ret){ LOG_WARN("fail to get in memory tablet handle", K(ret), K(key)); } + } else if (success) { + in_memory_tablet_handle.set_wash_priority(WashTabletPriority::WTP_LOW); } if (OB_SUCC(ret) || ignore_err_code(ret)) { ++idx_;