[CP] fix: fix the core induced by spf batch rescan

This commit is contained in:
obdev
2023-09-28 02:43:45 +00:00
committed by ob-robot
parent fe5316ab68
commit 508120bc1f
2 changed files with 26 additions and 6 deletions

View File

@ -779,11 +779,16 @@ int ObTableScanOp::prepare_all_das_tasks()
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
if (MY_SPEC.batch_scan_flag_) { if (MY_SPEC.batch_scan_flag_) {
if (OB_SUCC(ret)) { if (OB_SUCC(ret)) {
if (!tsc_rtdef_.bnlj_params_.empty()) {
group_size_ = tsc_rtdef_.bnlj_params_.at(0).second->count_; group_size_ = tsc_rtdef_.bnlj_params_.at(0).second->count_;
if (OB_UNLIKELY(group_size_ > max_group_size_)) { if (OB_UNLIKELY(group_size_ > max_group_size_)) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
LOG_WARN("The amount of data exceeds the pre allocated memory", K(ret)); LOG_WARN("The amount of data exceeds the pre allocated memory", K(ret));
} }
} else {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("batch nlj params is empty", K(ret));
}
} }
} }
if (OB_SUCC(ret)) { if (OB_SUCC(ret)) {
@ -1016,11 +1021,16 @@ int ObTableScanOp::prepare_batch_scan_range()
ObPhysicalPlanCtx *plan_ctx = GET_PHY_PLAN_CTX(ctx_); ObPhysicalPlanCtx *plan_ctx = GET_PHY_PLAN_CTX(ctx_);
int64_t batch_size = 0; int64_t batch_size = 0;
if (OB_SUCC(ret)) { if (OB_SUCC(ret)) {
if (!tsc_rtdef_.bnlj_params_.empty()) {
group_size_ = tsc_rtdef_.bnlj_params_.at(0).second->count_; group_size_ = tsc_rtdef_.bnlj_params_.at(0).second->count_;
if (OB_UNLIKELY(group_size_ > max_group_size_)) { if (OB_UNLIKELY(group_size_ > max_group_size_)) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
LOG_WARN("The amount of data exceeds the pre allocated memory", K(ret)); LOG_WARN("The amount of data exceeds the pre allocated memory", K(ret));
} }
} else {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("batch nlj params is empry", K(ret));
}
} }
for (int64_t i = 0; OB_SUCC(ret) && i < group_size_; ++i) { for (int64_t i = 0; OB_SUCC(ret) && i < group_size_; ++i) {
//replace real param to param store to extract scan range //replace real param to param store to extract scan range

View File

@ -560,6 +560,16 @@ int ObLogSubPlanFilter::check_and_set_das_group_rescan()
} }
} }
} }
// check if exec params contain sub_query
for (int64_t i = 0; OB_SUCC(ret) && enable_das_group_rescan_ && i < exec_params_.count(); i++) {
const ObExecParamRawExpr *exec_param = exec_params_.at(i);
if (OB_ISNULL(exec_param)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("exec param is nullptr", K(ret), K(i));
} else if (OB_NOT_NULL(exec_param->get_ref_expr()) && exec_param->get_ref_expr()->has_flag(CNT_SUB_QUERY)) {
enable_das_group_rescan_ = false;
}
}
// set use batch // set use batch
for (int64_t i = 1; OB_SUCC(ret) && i < get_num_of_child(); i++) { for (int64_t i = 1; OB_SUCC(ret) && i < get_num_of_child(); i++) {
ObLogicalOperator *child = get_child(i); ObLogicalOperator *child = get_child(i);