[scn] fix failure of mittest after refresh feature scn

This commit is contained in:
obdev
2022-11-28 01:46:42 +00:00
committed by ob-robot
parent 49a02f3304
commit 54b64a7263
1898 changed files with 255804 additions and 280809 deletions

View File

@ -59,7 +59,6 @@ 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,10 +183,6 @@ 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刷新并重试
@ -426,7 +422,6 @@ 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));
@ -634,7 +629,6 @@ 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,13 +14,12 @@
#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

@ -62,7 +62,7 @@ int ObRemoteIdentityTaskSpliter::get_next_task(ObTaskInfo *&task)
// t1 union t1这种情况, t1(p0) union t2(p0)这种情况,等等,
// 都是remote模式,但table_loc_list的count可能大于1
// 优化器必须保证:remote模式下,所有表的location都是一致的,并且都是单分区。
ObDASTabletLoc *first_tablet_loc = first_table_loc->get_first_tablet_loc();
ObDASTabletLoc *first_tablet_loc = first_table_loc->tablet_locs_.get_first();
if (OB_ISNULL(ptr = allocator_->alloc(sizeof(ObTaskInfo)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("fail to alloc ObTaskInfo", K(ret));

View File

@ -161,7 +161,7 @@ int ObRemoteScheduler::build_remote_task(ObExecContext &ctx,
remote_task.set_query_schema_version(task_exec_ctx.get_query_tenant_begin_schema_version(),
task_exec_ctx.get_query_sys_begin_schema_version());
remote_task.set_remote_sql_info(&plan_ctx->get_remote_sql_info());
ObDASTabletLoc *first_tablet_loc = DAS_CTX(ctx).get_table_loc_list().get_first()->get_first_tablet_loc();
ObDASTabletLoc *first_tablet_loc = DAS_CTX(ctx).get_table_loc_list().get_first()->tablet_locs_.get_first();
if (OB_ISNULL(session = ctx.get_my_session())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("session is null", K(ret));

View File

@ -326,8 +326,7 @@ int ObTaskExecutorCtxUtil::refresh_location_cache(ObTaskExecutorCtx &task_exec_c
DASTableLocList &table_locs = DAS_CTX(*task_exec_ctx.get_exec_context()).get_table_loc_list();
FOREACH_X(tmp_node, table_locs, OB_SUCC(ret)) {
ObDASTableLoc *table_loc = *tmp_node;
for (DASTabletLocListIter tablet_node = table_loc->tablet_locs_begin();
OB_SUCC(ret) && tablet_node != table_loc->tablet_locs_end(); ++tablet_node) {
FOREACH_X(tablet_node, table_loc->tablet_locs_, OB_SUCC(ret)) {
const ObDASTabletLoc *tablet_loc = *tablet_node;
if (is_nonblock) {
const int64_t expire_renew_time = 0; //表示在刷location cache之前不清空现有的location cache

View File

@ -19,10 +19,6 @@
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),
@ -92,5 +88,3 @@ int ObTaskInfo::ObRangeLocation::assign(const ObTaskInfo::ObRangeLocation &range
return ret;
}
}
}