[BUG.FIX] fix tmp file sanity coredump
This commit is contained in:
@ -655,7 +655,7 @@ void ObTmpFileMemTask::runTimerTask()
|
|||||||
|
|
||||||
ObTmpTenantMemBlockManager::IOWaitInfo::IOWaitInfo(
|
ObTmpTenantMemBlockManager::IOWaitInfo::IOWaitInfo(
|
||||||
ObMacroBlockHandle &block_handle, ObTmpMacroBlock &block, ObIAllocator &allocator)
|
ObMacroBlockHandle &block_handle, ObTmpMacroBlock &block, ObIAllocator &allocator)
|
||||||
: block_handle_(block_handle), block_(block), allocator_(allocator), ref_cnt_(0), ret_code_(OB_SUCCESS)
|
: block_handle_(&block_handle), block_(block), allocator_(allocator), ref_cnt_(0), ret_code_(OB_SUCCESS)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -713,7 +713,7 @@ int ObTmpTenantMemBlockManager::IOWaitInfo::exec_wait(int64_t io_timeout_ms)
|
|||||||
ObThreadCondGuard guard(cond_);
|
ObThreadCondGuard guard(cond_);
|
||||||
if (OB_FAIL(guard.get_ret())) {
|
if (OB_FAIL(guard.get_ret())) {
|
||||||
STORAGE_LOG(ERROR, "lock io request condition failed", K(ret), K(block_.get_block_id()));
|
STORAGE_LOG(ERROR, "lock io request condition failed", K(ret), K(block_.get_block_id()));
|
||||||
} else if (OB_FAIL(block_handle_.wait(io_timeout_ms))) {
|
} else if (OB_NOT_NULL(block_handle_) && OB_FAIL(block_handle_->wait(io_timeout_ms))) {
|
||||||
STORAGE_LOG(WARN, "wait handle wait io failed", K(ret), K(block_.get_block_id()));
|
STORAGE_LOG(WARN, "wait handle wait io failed", K(ret), K(block_.get_block_id()));
|
||||||
}
|
}
|
||||||
reset_io();
|
reset_io();
|
||||||
@ -740,7 +740,7 @@ ObTmpTenantMemBlockManager::IOWaitInfo::~IOWaitInfo()
|
|||||||
void ObTmpTenantMemBlockManager::IOWaitInfo::destroy()
|
void ObTmpTenantMemBlockManager::IOWaitInfo::destroy()
|
||||||
{
|
{
|
||||||
ret_code_ = OB_SUCCESS;
|
ret_code_ = OB_SUCCESS;
|
||||||
block_handle_.get_io_handle().reset();
|
reset_io();
|
||||||
if (0 != ATOMIC_LOAD(&ref_cnt_)) {
|
if (0 != ATOMIC_LOAD(&ref_cnt_)) {
|
||||||
int ret = OB_ERR_UNEXPECTED;
|
int ret = OB_ERR_UNEXPECTED;
|
||||||
STORAGE_LOG(ERROR, "unexpected error, ref cnt isn't zero", K(ret), KPC(this));
|
STORAGE_LOG(ERROR, "unexpected error, ref cnt isn't zero", K(ret), KPC(this));
|
||||||
@ -749,7 +749,10 @@ void ObTmpTenantMemBlockManager::IOWaitInfo::destroy()
|
|||||||
|
|
||||||
void ObTmpTenantMemBlockManager::IOWaitInfo::reset_io()
|
void ObTmpTenantMemBlockManager::IOWaitInfo::reset_io()
|
||||||
{
|
{
|
||||||
block_handle_.get_io_handle().reset();
|
if (OB_NOT_NULL(block_handle_)) {
|
||||||
|
block_handle_->get_io_handle().reset();
|
||||||
|
block_handle_ = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ObTmpTenantMemBlockManager::ObIOWaitInfoHandle::ObIOWaitInfoHandle()
|
ObTmpTenantMemBlockManager::ObIOWaitInfoHandle::ObIOWaitInfoHandle()
|
||||||
@ -1450,9 +1453,12 @@ int ObTmpTenantMemBlockManager::exec_wait()
|
|||||||
if (OB_ISNULL(wait_info = static_cast<IOWaitInfo*>(node))) {
|
if (OB_ISNULL(wait_info = static_cast<IOWaitInfo*>(node))) {
|
||||||
ret = OB_ERR_UNEXPECTED;
|
ret = OB_ERR_UNEXPECTED;
|
||||||
STORAGE_LOG(ERROR, "unexpected error, wait info is nullptr", K(ret), KP(node));
|
STORAGE_LOG(ERROR, "unexpected error, wait info is nullptr", K(ret), KP(node));
|
||||||
|
} else if (OB_ISNULL(wait_info->block_handle_)) {
|
||||||
|
ret = OB_ERR_UNEXPECTED;
|
||||||
|
STORAGE_LOG(ERROR, "unexpected error, macro handle in wait info is nullptr", K(ret), KPC(wait_info));
|
||||||
} else {
|
} else {
|
||||||
ObTmpMacroBlock &blk = wait_info->get_block();
|
ObTmpMacroBlock &blk = wait_info->get_block();
|
||||||
const MacroBlockId ¯o_id = wait_info->block_handle_.get_macro_id();
|
const MacroBlockId ¯o_id = wait_info->block_handle_->get_macro_id();
|
||||||
const int64_t block_id = blk.get_block_id();
|
const int64_t block_id = blk.get_block_id();
|
||||||
const int64_t free_page_nums = blk.get_free_page_nums();
|
const int64_t free_page_nums = blk.get_free_page_nums();
|
||||||
if (OB_FAIL(wait_info->exec_wait(io_timeout_ms))) {
|
if (OB_FAIL(wait_info->exec_wait(io_timeout_ms))) {
|
||||||
|
|||||||
@ -285,13 +285,13 @@ public:
|
|||||||
void reset_io();
|
void reset_io();
|
||||||
int broadcast();
|
int broadcast();
|
||||||
OB_INLINE ObTmpMacroBlock& get_block() { return block_; };
|
OB_INLINE ObTmpMacroBlock& get_block() { return block_; };
|
||||||
TO_STRING_KV(K_(block), K_(block_handle), K_(ref_cnt), K_(ret_code));
|
TO_STRING_KV(K_(block), KPC_(block_handle), K_(ref_cnt), K_(ret_code));
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ObMacroBlockHandle &block_handle_;
|
ObMacroBlockHandle *block_handle_;
|
||||||
ObTmpMacroBlock &block_;
|
ObTmpMacroBlock &block_;
|
||||||
ObThreadCond cond_;
|
ObThreadCond cond_;
|
||||||
ObIAllocator &allocator_;
|
ObIAllocator &allocator_;
|
||||||
|
|||||||
Reference in New Issue
Block a user