Added tracepoint control flush plan cache does not clean up leak memory

This commit is contained in:
obdev
2023-08-02 09:24:21 +00:00
committed by ob-robot
parent 9dab2044da
commit 995d8925e1
2 changed files with 50 additions and 29 deletions

View File

@ -707,6 +707,7 @@ class EventTable
// sql parameterization 1170-1180
EN_SQL_PARAM_FP_NP_NOT_SAME_ERROR = 1170,
EN_FLUSH_PC_NOT_CLEANUP_LEAK_MEM_ERROR = 1171,
// END OF sql parameterization 1170-1180
// session info verification

View File

@ -1967,6 +1967,9 @@ int ObPlanCache::flush_plan_cache()
} else if (OB_FAIL(dump_deleted_objs<DUMP_SQL>(deleted_objs, safe_timestamp))) {
SQL_PC_LOG(WARN, "failed to get deleted sql objs", K(ret));
} else {
int tmp_ret = OB_SUCCESS;
tmp_ret = OB_E(EventTable::EN_FLUSH_PC_NOT_CLEANUP_LEAK_MEM_ERROR) OB_SUCCESS;
if (OB_SUCCESS == tmp_ret) {
LOG_INFO("Deleted Cache Objs", K(deleted_objs));
for (int64_t i = 0; i < deleted_objs.count(); i++) { // ignore error code and continue
if (OB_FAIL(ObCacheObjectFactory::destroy_cache_obj(true,
@ -1976,6 +1979,7 @@ int ObPlanCache::flush_plan_cache()
}
}
}
}
return ret;
}
@ -1996,6 +2000,9 @@ int ObPlanCache::flush_plan_cache_by_sql_id(uint64_t db_id, common::ObString sql
} else if (OB_FAIL(dump_deleted_objs<DUMP_SQL>(deleted_objs, safe_timestamp))) {
SQL_PC_LOG(WARN, "failed to get deleted sql objs", K(ret));
} else {
int tmp_ret = OB_SUCCESS;
tmp_ret = OB_E(EventTable::EN_FLUSH_PC_NOT_CLEANUP_LEAK_MEM_ERROR) OB_SUCCESS;
if (OB_SUCCESS == tmp_ret) {
LOG_INFO("Deleted Cache Objs", K(deleted_objs));
for (int64_t i = 0; i < deleted_objs.count(); i++) { // ignore error code and continue
if (OB_FAIL(ObCacheObjectFactory::destroy_cache_obj(true,
@ -2005,6 +2012,7 @@ int ObPlanCache::flush_plan_cache_by_sql_id(uint64_t db_id, common::ObString sql
}
}
}
}
return ret;
}
@ -2024,6 +2032,9 @@ int ObPlanCache::flush_lib_cache()
} else if (OB_FAIL(dump_deleted_objs<DUMP_ALL>(deleted_objs, safe_timestamp))) {
SQL_PC_LOG(WARN, "failed to get deleted sql objs", K(ret));
} else {
int tmp_ret = OB_SUCCESS;
tmp_ret = OB_E(EventTable::EN_FLUSH_PC_NOT_CLEANUP_LEAK_MEM_ERROR) OB_SUCCESS;
if (OB_SUCCESS == tmp_ret) {
LOG_INFO("Deleted Cache Objs", K(deleted_objs));
for (int64_t i = 0; i < deleted_objs.count(); i++) { // ignore error code and continue
if (OB_FAIL(ObCacheObjectFactory::destroy_cache_obj(true,
@ -2033,6 +2044,7 @@ int ObPlanCache::flush_lib_cache()
}
}
}
}
return ret;
}
@ -2050,6 +2062,9 @@ int ObPlanCache::flush_lib_cache_by_ns(const ObLibCacheNameSpace ns)
} else if (OB_FAIL(dump_deleted_objs_by_ns(deleted_objs, safe_timestamp, ns))) {
SQL_PC_LOG(ERROR, "failed to dump deleted objs by ns", K(ret));
} else {
int tmp_ret = OB_SUCCESS;
tmp_ret = OB_E(EventTable::EN_FLUSH_PC_NOT_CLEANUP_LEAK_MEM_ERROR) OB_SUCCESS;
if (OB_SUCCESS == tmp_ret) {
LOG_INFO("Deleted Cache Objs", K(deleted_objs));
for (int i = 0; i < deleted_objs.count(); i++) { // ignore error code and continue
if (OB_FAIL(ObCacheObjectFactory::destroy_cache_obj(true,
@ -2059,6 +2074,7 @@ int ObPlanCache::flush_lib_cache_by_ns(const ObLibCacheNameSpace ns)
}
}
}
}
return ret;
}
@ -2077,6 +2093,9 @@ int ObPlanCache::flush_pl_cache()
} else if (OB_FAIL(dump_deleted_objs<DUMP_PL>(deleted_objs, safe_timestamp))) {
SQL_PC_LOG(ERROR, "failed to dump deleted pl objs", K(ret));
} else {
int tmp_ret = OB_SUCCESS;
tmp_ret = OB_E(EventTable::EN_FLUSH_PC_NOT_CLEANUP_LEAK_MEM_ERROR) OB_SUCCESS;
if (OB_SUCCESS == tmp_ret) {
LOG_INFO("Deleted Cache Objs", K(deleted_objs));
for (int i = 0; i < deleted_objs.count(); i++) { // ignore error code and continue
if (OB_FAIL(ObCacheObjectFactory::destroy_cache_obj(true,
@ -2086,6 +2105,7 @@ int ObPlanCache::flush_pl_cache()
}
}
}
}
return ret;
}