add debug log for dag memleak

This commit is contained in:
yangqise7en
2023-07-13 09:42:25 +00:00
committed by ob-robot
parent 15c769d3b7
commit b9780d0b60
2 changed files with 11 additions and 7 deletions

View File

@ -1649,7 +1649,9 @@ void ObTenantDagScheduler::destroy()
destroy_all_workers(); destroy_all_workers();
is_inited_ = false; // avoid alloc dag/dag_net is_inited_ = false; // avoid alloc dag/dag_net
WEAK_BARRIER();
int tmp_ret = OB_SUCCESS; int tmp_ret = OB_SUCCESS;
int64_t abort_dag_cnt = 0;
for (int64_t j = 0; j < DAG_LIST_MAX; ++j) { for (int64_t j = 0; j < DAG_LIST_MAX; ++j) {
for (int64_t i = 0; i < PriorityDagList::PRIO_CNT; ++i) { for (int64_t i = 0; i < PriorityDagList::PRIO_CNT; ++i) {
ObIDag *head = dag_list_[j].get_head(i); ObIDag *head = dag_list_[j].get_head(i);
@ -1666,10 +1668,12 @@ void ObTenantDagScheduler::destroy()
} }
if (OB_TMP_FAIL(finish_dag_(ObIDag::DAG_STATUS_ABORT, *cur_dag, tmp_dag_net))) { if (OB_TMP_FAIL(finish_dag_(ObIDag::DAG_STATUS_ABORT, *cur_dag, tmp_dag_net))) {
STORAGE_LOG_RET(WARN, tmp_ret, "failed to abort dag", K(tmp_ret), KPC(cur_dag)); STORAGE_LOG_RET(WARN, tmp_ret, "failed to abort dag", K(tmp_ret), KPC(cur_dag));
} else {
++abort_dag_cnt;
} }
cur_dag = next; cur_dag = next;
} // end of while } // end of while
} } // end of prio loop
dag_list_[j].reset(); dag_list_[j].reset();
} // end of for } // end of for
blocking_dag_net_list_.reset(); blocking_dag_net_list_.reset();
@ -1692,7 +1696,7 @@ void ObTenantDagScheduler::destroy()
if (dag_net_id_map_.created()) { if (dag_net_id_map_.created()) {
dag_net_id_map_.destroy(); dag_net_id_map_.destroy();
} }
COMMON_LOG(INFO, "ObTenantDagScheduler before allocator destroyed", K(abort_dag_cnt), K(allocator_.used()), K(ha_allocator_.used()));
allocator_.reset(); allocator_.reset();
ha_allocator_.reset(); ha_allocator_.reset();
scheduler_sync_.destroy(); scheduler_sync_.destroy();
@ -1872,10 +1876,7 @@ int ObTenantDagScheduler::add_dag(
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
if (IS_NOT_INIT) { if (OB_ISNULL(dag)) {
ret = OB_NOT_INIT;
COMMON_LOG(WARN, "ObTenantDagScheduler is not inited", K(ret));
} else if (OB_ISNULL(dag)) {
ret = OB_INVALID_ARGUMENT; ret = OB_INVALID_ARGUMENT;
COMMON_LOG(WARN, "invalid argument", KP(dag)); COMMON_LOG(WARN, "invalid argument", KP(dag));
} else if (OB_UNLIKELY(!dag->is_valid())) { } else if (OB_UNLIKELY(!dag->is_valid())) {

View File

@ -1086,7 +1086,10 @@ int ObTenantDagScheduler::create_dag(
T *&dag) T *&dag)
{ {
int ret = common::OB_SUCCESS; int ret = common::OB_SUCCESS;
if (OB_FAIL(alloc_dag(dag))) { if (IS_NOT_INIT) {
ret = OB_NOT_INIT;
COMMON_LOG(WARN, "ObTenantDagScheduler is not inited", K(ret));
} else if (OB_FAIL(alloc_dag(dag))) {
COMMON_LOG(WARN, "failed to alloc dag", K(ret)); COMMON_LOG(WARN, "failed to alloc dag", K(ret));
} else if (OB_FAIL(dag->init_by_param(param))) { } else if (OB_FAIL(dag->init_by_param(param))) {
COMMON_LOG(WARN, "failed to init dag", K(ret), KPC(dag)); COMMON_LOG(WARN, "failed to init dag", K(ret), KPC(dag));