[SCN] fix farm failure

This commit is contained in:
obdev
2022-11-28 02:58:33 +00:00
committed by ob-robot
parent 87a9357186
commit 51de5b5911
594 changed files with 9722 additions and 7770 deletions

View File

@ -59,6 +59,7 @@ int ObExecutor::execute_plan(ObExecContext &ctx)
ObSQLSessionInfo *session_info = ctx.get_my_session();
ObPhysicalPlanCtx *plan_ctx = ctx.get_physical_plan_ctx();
int64_t batched_stmt_cnt = ctx.get_sql_ctx()->multi_stmt_item_.get_batched_stmt_cnt();
ctx.set_use_temp_expr_ctx_cache(true);
// If the batch execution is rewritten by insert multi values, there is no need to repack multiple times
if (ctx.get_sql_ctx()->multi_stmt_item_.is_ins_multi_val_opt()) {
batched_stmt_cnt = 0;

View File

@ -183,6 +183,10 @@ int ObRemoteBaseExecuteP<T>::base_before_process(int64_t tenant_schema_version,
if (is_schema_error(ret)) {
ret = OB_ERR_WAIT_REMOTE_SCHEMA_REFRESH; // 重写错误码,使得scheduler端能等待远端schema刷新并重试
}
} else if (-1 == tenant_schema_version && ret == OB_TENANT_NOT_EXIST) {
// fix bug: https://work.aone.alibaba-inc.com/issue/45890226
// 控制端重启observer,导致租户schema没刷出来,发送过来的schema_version异常, 让对端重试
ret = OB_ERR_WAIT_REMOTE_SCHEMA_REFRESH;
} else {
if (OB_SCHEMA_ERROR == ret || OB_SCHEMA_EAGAIN == ret) {
ret = OB_ERR_WAIT_REMOTE_SCHEMA_REFRESH; // 针对OB_SCHEMA_ERROR 和OB_SCHEMA_EAGAIN这两个错误码,远程执行暂时先考虑重写,等待远端schema刷新并重试
@ -422,6 +426,7 @@ int ObRemoteBaseExecuteP<T>::execute_remote_plan(ObExecContext &exec_ctx,
ObSQLSessionInfo *session = exec_ctx.get_my_session();
ObPhysicalPlanCtx *plan_ctx = exec_ctx.get_physical_plan_ctx();
ObOperator *se_op = nullptr; // static engine operator
exec_ctx.set_use_temp_expr_ctx_cache(true);
if (OB_ISNULL(plan_ctx) || OB_ISNULL(session)) {
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("op is NULL", K(ret), K(plan_ctx), K(session));
@ -629,6 +634,7 @@ int ObRemoteBaseExecuteP<T>::execute_with_sql(ObRemoteTask &task)
bool enable_sql_audit = GCONF.enable_sql_audit;
ObPhysicalPlan *plan = nullptr;
ObPhysicalPlanCtx *plan_ctx = nullptr;
exec_ctx_.set_use_temp_expr_ctx_cache(false);
int inject_err_no = EVENT_CALL(EventTable::EN_REMOTE_EXEC_ERR);
if (0 != inject_err_no) {
ret = inject_err_no;

View File

@ -14,12 +14,13 @@
#define OBDEV_SRC_SQL_EXECUTOR_OB_REMOTE_EXECUTOR_PROCESSOR_H_
#include "sql/executor/ob_executor_rpc_processor.h"
#include "sql/plan_cache/ob_cache_object_factory.h"
namespace oceanbase
{
namespace observer
{
struct ObGlobalContext;
}
namespace oceanbase
{
namespace sql
{
template <typename T>

View File

@ -19,6 +19,10 @@
using namespace oceanbase::common;
using namespace oceanbase::sql;
namespace oceanbase
{
namespace sql
{
ObTaskInfo::ObTaskInfo(common::ObIAllocator &allocator)
: range_location_(allocator),
task_split_type_(ObTaskSpliter::INVALID_SPLIT),
@ -88,3 +92,5 @@ int ObTaskInfo::ObRangeLocation::assign(const ObTaskInfo::ObRangeLocation &range
return ret;
}
}
}