Fix table load resource leak when tenant are evicted

This commit is contained in:
obdev
2023-03-02 15:39:03 +00:00
committed by ob-robot
parent 8f3533aad4
commit fe94e4d341
12 changed files with 355 additions and 237 deletions

View File

@ -36,10 +36,12 @@ ObTableLoadInstance::~ObTableLoadInstance() { destroy(); }
void ObTableLoadInstance::destroy()
{
int ret = OB_SUCCESS;
trans_ctx_.reset();
if (nullptr != table_ctx_) {
ObTableLoadService::remove_ctx(table_ctx_);
if (!is_committed_) {
if (OB_FAIL(ObTableLoadService::remove_ctx(table_ctx_))) {
LOG_WARN("table ctx may remove by service", KR(ret), KP(table_ctx_));
} else if (!is_committed_) {
ObTableLoadCoordinator::abort_ctx(table_ctx_, *session_info_);
}
ObTableLoadService::put_ctx(table_ctx_);