提交 4223b124 编写于 作者: S sl0 提交者: wangzelin.wzl

remote sql executor not retry when get plan

上级 1198d56c
......@@ -975,6 +975,7 @@ int ObSql::handle_remote_query(const ObRemoteSqlInfo& remote_sql_info, ObSqlCtx&
context,
exec_ctx,
tenant_id);
pc_ctx->is_remote_executor_ = true;
if (remote_sql_info.use_ps_) {
// 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
......@@ -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));
}
}
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;
session->set_use_static_typing_engine(false);
ObPhysicalPlanCtx* pctx = pc_ctx.exec_ctx_.get_physical_plan_ctx();
......
......@@ -469,7 +469,8 @@ struct ObPlanCacheCtx {
should_add_plan_(true),
must_be_positive_index_(),
multi_stmt_fp_results_(allocator),
handle_id_(MAX_HANDLE)
handle_id_(MAX_HANDLE),
is_remote_executor_(false)
{
bl_key_.tenant_id_ = tenant_id;
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
common::ObFixedArray<ObFastParserResult, common::ObIAllocator> multi_stmt_fp_results_;
CacheRefHandleID handle_id_;
bool is_remote_executor_;
};
struct ObPlanCacheStat {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册