fix sqc hanler memory leak

This commit is contained in:
obdev 2024-07-09 04:15:47 +00:00 committed by ob-robot
parent 84da6a95aa
commit d913efca8b
3 changed files with 14 additions and 0 deletions

View File

@ -378,6 +378,7 @@ GLOBAL_ERRSIM_POINT_DEF(615, EN_PX_MAX_IN_FILTER_QR_COUNT, "Switch: control the
GLOBAL_ERRSIM_POINT_DEF(616, EN_PX_DISABLE_WHITE_RUNTIME_FILTER, "Switch: used to disable runtime filter pushdown as white filter.");
GLOBAL_ERRSIM_POINT_DEF(617, EN_PX_DISABLE_PD_TOPN_FILTER, "Switch: used to disable runtime topn filter pushdown.");
GLOBAL_ERRSIM_POINT_DEF(618, EN_PX_PD_TOPN_FILTER_IGNORE_TABLE_CARD, "Switch: allocate topn filter expr even if less table card");
GLOBAL_ERRSIM_POINT_DEF(619, EN_PX_SQC_HANDLER_INIT_FAILED, "Inject error: let sqc handler init failed");
// please add new trace point after 700 or before 600
// Compaction Related 700-750

View File

@ -39,6 +39,8 @@ int ObInitSqcP::init()
LOG_WARN("unexpected sqc handler", K(ret));
} else if (OB_FAIL(sqc_handler->init())) {
LOG_WARN("Failed to init sqc handler", K(ret));
sqc_handler->reset();
op_reclaim_free(sqc_handler);
} else {
arg_.sqc_handler_ = sqc_handler;
arg_.sqc_handler_->reset_reference_count(); //设置sqc_handler的引用计数为1.
@ -363,6 +365,8 @@ int ObInitFastSqcP::init()
LOG_WARN("unexpected sqc handler", K(ret));
} else if (OB_FAIL(sqc_handler->init())) {
LOG_WARN("Failed to init sqc handler", K(ret));
sqc_handler->reset();
op_reclaim_free(sqc_handler);
} else {
arg_.sqc_handler_ = sqc_handler;
arg_.sqc_handler_->reset_reference_count(); //设置sqc_handler的引用计数为1.

View File

@ -207,6 +207,15 @@ int ObPxSqcHandler::init()
} else {
exec_ctx_->set_sqc_handler(this);
}
#ifdef ERRSIM
int errsim_code = EventTable::EN_PX_SQC_HANDLER_INIT_FAILED;
if (OB_SUCC(ret) && errsim_code != OB_SUCCESS) {
ret = errsim_code;
LOG_TRACE("Force sqc hanler init failed", K(ret));
}
#endif
return ret;
}