remote sql executor not retry when get plan
This commit is contained in:
@ -975,6 +975,7 @@ int ObSql::handle_remote_query(const ObRemoteSqlInfo& remote_sql_info, ObSqlCtx&
|
|||||||
context,
|
context,
|
||||||
exec_ctx,
|
exec_ctx,
|
||||||
tenant_id);
|
tenant_id);
|
||||||
|
pc_ctx->is_remote_executor_ = true;
|
||||||
if (remote_sql_info.use_ps_) {
|
if (remote_sql_info.use_ps_) {
|
||||||
// the execution plan of the ps mode and the ordinary text protocol cannot be reused,
|
// the execution plan of the ps mode and the ordinary text protocol cannot be reused,
|
||||||
// it is necessary to distinguish here to avoid some problems when querying the plan
|
// it is necessary to distinguish here to avoid some problems when querying the plan
|
||||||
@ -2536,7 +2537,12 @@ int ObSql::execute_get_plan(ObPlanCache& plan_cache, ObPlanCacheCtx& pc_ctx, ObP
|
|||||||
LOG_WARN("fail to get physical plan", K(ret));
|
LOG_WARN("fail to get physical plan", K(ret));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (OB_SQL_PC_NOT_EXIST == ret && session->use_static_typing_engine()) {
|
// 如果是新引擎执行时出现get不到的情况, 则关闭新引擎, 重新再一次get, 避免出现因为新
|
||||||
|
// 引擎本身不支持的计划时, 生成的新计划是老的执行计划并加入到了plan cache,
|
||||||
|
// 而get时总get 不到老计划的情况
|
||||||
|
if (OB_SQL_PC_NOT_EXIST == ret
|
||||||
|
&& session->use_static_typing_engine()
|
||||||
|
&& !pc_ctx.is_remote_executor_) {
|
||||||
ret = OB_SUCCESS;
|
ret = OB_SUCCESS;
|
||||||
session->set_use_static_typing_engine(false);
|
session->set_use_static_typing_engine(false);
|
||||||
ObPhysicalPlanCtx* pctx = pc_ctx.exec_ctx_.get_physical_plan_ctx();
|
ObPhysicalPlanCtx* pctx = pc_ctx.exec_ctx_.get_physical_plan_ctx();
|
||||||
|
|||||||
@ -469,7 +469,8 @@ struct ObPlanCacheCtx {
|
|||||||
should_add_plan_(true),
|
should_add_plan_(true),
|
||||||
must_be_positive_index_(),
|
must_be_positive_index_(),
|
||||||
multi_stmt_fp_results_(allocator),
|
multi_stmt_fp_results_(allocator),
|
||||||
handle_id_(MAX_HANDLE)
|
handle_id_(MAX_HANDLE),
|
||||||
|
is_remote_executor_(false)
|
||||||
{
|
{
|
||||||
bl_key_.tenant_id_ = tenant_id;
|
bl_key_.tenant_id_ = tenant_id;
|
||||||
fp_result_.pc_key_.is_ps_mode_ = is_ps_mode_;
|
fp_result_.pc_key_.is_ps_mode_ = is_ps_mode_;
|
||||||
@ -548,6 +549,7 @@ struct ObPlanCacheCtx {
|
|||||||
// used for store fp results for multi_stmt optimization
|
// used for store fp results for multi_stmt optimization
|
||||||
common::ObFixedArray<ObFastParserResult, common::ObIAllocator> multi_stmt_fp_results_;
|
common::ObFixedArray<ObFastParserResult, common::ObIAllocator> multi_stmt_fp_results_;
|
||||||
CacheRefHandleID handle_id_;
|
CacheRefHandleID handle_id_;
|
||||||
|
bool is_remote_executor_;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ObPlanCacheStat {
|
struct ObPlanCacheStat {
|
||||||
|
|||||||
Reference in New Issue
Block a user