[CP] [CP] Fix reference count leak when stmt_info expires

This commit is contained in:
obdev
2022-08-25 18:14:54 +08:00
committed by wangzelin.wzl
parent 649a2dc6f7
commit 4e81072cd2
7 changed files with 95 additions and 17 deletions

View File

@ -56,7 +56,19 @@ void ObPsStmtItemDerefAtomicOp::operator()(const PsStmtIdKV& entry)
}
}
void ObPsStmtInfoRefAtomicOp::operator()(const PsStmtInfoKV& entry)
void ObPsStmtItemEraseAtomicOp::operator()(const PsStmtIdKV &entry)
{
if (OB_ISNULL(entry.second)) {
ret_ = OB_HASH_NOT_EXIST;
LOG_WARN("entry not exist", K_(ret));
} else if (entry.second->get_ps_stmt_id() == stmt_id_) {
if (ATOMIC_BCAS(entry.second->get_is_expired_evicted_ptr(), false, true)) {
need_erase_ = true;
}
}
}
void ObPsStmtInfoRefAtomicOp::operator()(const PsStmtInfoKV &entry)
{
if (NULL != entry.second) {
if (entry.second->check_erase_inc_ref_count()) {