[BUG.FIX] Bad block inspection skips temporary file macro blocks
This commit is contained in:
@ -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));
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -305,7 +305,7 @@ void ObMetaObjGuard<T>::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_) {
|
||||
|
||||
@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user