fix unit gc makes no progress cuased by tmp file deadlock
This commit is contained in:
@ -954,7 +954,7 @@ int ObTmpTenantMemBlockManager::DestroyBlockMapOp::operator () (oceanbase::commo
|
||||
} else if (OB_FAIL(blk->give_back_buf_into_cache())) {
|
||||
STORAGE_LOG(WARN, "fail to put tmp block cache", K(ret), K(blk));
|
||||
} else {
|
||||
OB_TMP_FILE_STORE.dec_block_cache_num(blk->get_tenant_id(), 1);
|
||||
tenant_store_.dec_block_cache_num(1);
|
||||
}
|
||||
} else {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
@ -987,7 +987,7 @@ void ObTmpTenantMemBlockManager::destroy()
|
||||
}
|
||||
}
|
||||
ATOMIC_STORE(&washing_count_, 0);
|
||||
DestroyBlockMapOp op;
|
||||
DestroyBlockMapOp op(tenant_store_);
|
||||
if (OB_FAIL(t_mblk_map_.foreach_refactored(op))) {
|
||||
// overwrite ret
|
||||
STORAGE_LOG(WARN, "destroy mblk map failed", K(ret));
|
||||
@ -1266,7 +1266,7 @@ int ObTmpTenantMemBlockManager::check_and_free_mem_block(ObTmpMacroBlock *&t_mbl
|
||||
} else if (OB_FAIL(free_macro_block(t_mblk->get_block_id()))) {
|
||||
STORAGE_LOG(WARN, "fail to free tmp macro block for block cache", K(ret));
|
||||
} else {
|
||||
OB_TMP_FILE_STORE.dec_block_cache_num(tenant_id_, 1);
|
||||
tenant_store_.dec_block_cache_num(1);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -1549,7 +1549,7 @@ int ObTmpTenantMemBlockManager::exec_wait()
|
||||
}
|
||||
} else {
|
||||
++wait_io_cnt;
|
||||
OB_TMP_FILE_STORE.dec_block_cache_num(tenant_id_, 1);
|
||||
tenant_store_.dec_block_cache_num(1);
|
||||
ObTaskController::get().allow_next_syslog();
|
||||
STORAGE_LOG(INFO, "succeed to wash a block", K(block_id), K(macro_id),
|
||||
K(free_page_nums), K(t_mblk_map_.size()));
|
||||
|
@ -425,8 +425,10 @@ private:
|
||||
struct DestroyBlockMapOp final
|
||||
{
|
||||
public:
|
||||
DestroyBlockMapOp() = default;
|
||||
DestroyBlockMapOp(ObTmpTenantFileStore &tenant_store) : tenant_store_(tenant_store) {}
|
||||
int operator () (oceanbase::common::hash::HashMapPair<int64_t, ObTmpMacroBlock*> &entry);
|
||||
private:
|
||||
ObTmpTenantFileStore &tenant_store_; // reference to tenant store from ObTmpTenantMemBlockManager
|
||||
};
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user