[BUG] free the memory when batch remove

This commit is contained in:
Handora 2023-05-17 14:47:16 +00:00 committed by ob-robot
parent 2aa05a2a71
commit 36608dd357

View File

@ -452,6 +452,20 @@ void ObTenantMetaMemMgr::batch_gc_memtable_()
}
if (REACH_TENANT_TIME_INTERVAL(1_hour)) {
for (auto iter = gc_memtable_map_.begin();
iter != gc_memtable_map_.end(); ++iter) {
memtable::ObMemtableSet *memtable_set = iter->second;
if (OB_NOT_NULL(memtable_set)) {
if (0 != memtable_set->size()) {
LOG_ERROR("leaked memtable", KPC(memtable_set));
}
if (OB_FAIL(memtable_set->destroy())) {
LOG_ERROR("memtable set destroy failed", K(ret));
}
ob_free(memtable_set);
}
}
if (OB_TMP_FAIL(gc_memtable_map_.clear())) {
LOG_ERROR("clear gc memtable map failed", K(tmp_ret));
}