Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
caoersss
oceanbase
提交
f2b3572e
O
oceanbase
项目概览
caoersss
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f2b3572e
编写于
7月 26, 2021
作者:
L
lck0
提交者:
wangzelin.wzl
7月 26, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
patch some bugfixs into opensource
上级
821da37d
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
68 addition
and
43 deletion
+68
-43
src/observer/mysql/ob_sync_plan_driver.cpp
src/observer/mysql/ob_sync_plan_driver.cpp
+2
-0
src/observer/ob_inner_sql_result.cpp
src/observer/ob_inner_sql_result.cpp
+3
-0
src/sql/engine/dml/ob_table_modify.cpp
src/sql/engine/dml/ob_table_modify.cpp
+0
-3
src/sql/engine/px/ob_dfo_scheduler.cpp
src/sql/engine/px/ob_dfo_scheduler.cpp
+21
-25
src/sql/engine/px/ob_px_rpc_processor.cpp
src/sql/engine/px/ob_px_rpc_processor.cpp
+24
-9
src/sql/engine/px/ob_px_sqc_async_proxy.cpp
src/sql/engine/px/ob_px_sqc_async_proxy.cpp
+0
-5
src/sql/engine/px/ob_px_worker.cpp
src/sql/engine/px/ob_px_worker.cpp
+1
-0
src/sql/ob_result_set.cpp
src/sql/ob_result_set.cpp
+13
-0
src/sql/ob_result_set.h
src/sql/ob_result_set.h
+1
-0
src/sql/resolver/expr/ob_raw_expr_printer.cpp
src/sql/resolver/expr/ob_raw_expr_printer.cpp
+2
-1
src/sql/resolver/expr/ob_raw_expr_resolver_impl.cpp
src/sql/resolver/expr/ob_raw_expr_resolver_impl.cpp
+1
-0
未找到文件。
src/observer/mysql/ob_sync_plan_driver.cpp
浏览文件 @
f2b3572e
...
...
@@ -82,6 +82,8 @@ int ObSyncPlanDriver::response_result(ObMySQLResultSet& result)
retry_ctrl_
.
test_and_save_retry_state
(
gctx_
,
ctx_
,
result
,
ret
,
cli_ret
);
LOG_WARN
(
"result response failed, check if need retry"
,
K
(
ret
),
K
(
cli_ret
),
K
(
retry_ctrl_
.
need_retry
()));
ret
=
cli_ret
;
}
else
{
ObResultSet
::
refresh_location_cache
(
result
.
get_exec_context
().
get_task_exec_ctx
(),
true
,
ret
);
}
// After judging whether you need to retry, we won't judge whether to retry later
THIS_WORKER
.
disable_retry
();
...
...
src/observer/ob_inner_sql_result.cpp
浏览文件 @
f2b3572e
...
...
@@ -100,6 +100,7 @@ int ObInnerSQLResult::open()
ret
=
OB_INIT_TWICE
;
LOG_WARN
(
"result set already open"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
result_set_
->
sync_open
()))
{
ObResultSet
::
refresh_location_cache
(
result_set_
->
get_exec_context
().
get_task_exec_ctx
(),
true
,
ret
);
LOG_WARN
(
"open result set failed"
,
K
(
ret
));
// move after precess_retry().
// result_set_->close();
...
...
@@ -147,6 +148,7 @@ int ObInnerSQLResult::inner_close(bool need_retry)
WITH_CONTEXT
(
mem_context_
)
{
if
(
OB_FAIL
(
result_set_
->
close
(
need_retry
)))
{
ObResultSet
::
refresh_location_cache
(
result_set_
->
get_exec_context
().
get_task_exec_ctx
(),
true
,
ret
);
LOG_WARN
(
"result set close failed"
,
K
(
ret
),
K
(
need_retry
));
}
}
...
...
@@ -168,6 +170,7 @@ int ObInnerSQLResult::next()
{
if
(
OB_FAIL
(
result_set_
->
get_next_row
(
row_
)))
{
if
(
OB_ITER_END
!=
ret
)
{
ObResultSet
::
refresh_location_cache
(
result_set_
->
get_exec_context
().
get_task_exec_ctx
(),
true
,
ret
);
LOG_WARN
(
"get next row failed"
,
K
(
ret
));
}
}
...
...
src/sql/engine/dml/ob_table_modify.cpp
浏览文件 @
f2b3572e
...
...
@@ -405,7 +405,6 @@ OB_DEF_SERIALIZE(ObTableModify)
}
OB_UNIS_ENCODE
(
is_pdml_index_maintain_
);
OB_UNIS_ENCODE
(
table_location_uncertain_
);
OB_UNIS_ENCODE
(
is_pdml_index_maintain_
);
return
ret
;
}
...
...
@@ -487,7 +486,6 @@ OB_DEF_DESERIALIZE(ObTableModify)
OB_UNIS_DECODE_EXPR_DLIST
(
ObSqlExpression
,
tsc_virtual_column_exprs_
,
my_phy_plan_
);
OB_UNIS_DECODE
(
is_pdml_index_maintain_
);
OB_UNIS_DECODE
(
table_location_uncertain_
);
OB_UNIS_DECODE
(
is_pdml_index_maintain_
);
return
ret
;
}
...
...
@@ -532,7 +530,6 @@ OB_DEF_SERIALIZE_SIZE(ObTableModify)
len
+=
get_dlist_serialize_size
(
tsc_virtual_column_exprs_
);
OB_UNIS_ADD_LEN
(
is_pdml_index_maintain_
);
OB_UNIS_ADD_LEN
(
table_location_uncertain_
);
OB_UNIS_ADD_LEN
(
is_pdml_index_maintain_
);
return
len
;
}
...
...
src/sql/engine/px/ob_dfo_scheduler.cpp
浏览文件 @
f2b3572e
...
...
@@ -980,34 +980,30 @@ int ObParallelDfoScheduler::dispatch_sqc(
}
else
{
LOG_WARN
(
"fail to wait all async init sqc"
,
K
(
ret
),
K
(
exec_ctx
));
}
}
int
saved_ret
=
ret
;
ret
=
OB_SUCCESS
;
const
ObArray
<
ObSqcAsyncCB
*>&
callbacks
=
proxy
.
get_callbacks
();
ARRAY_FOREACH
(
callbacks
,
idx
)
{
const
ObSqcAsyncCB
*
cb
=
callbacks
.
at
(
idx
);
const
ObPxRpcInitSqcResponse
&
resp
=
(
*
cb
).
get_result
();
ObPxSqcMeta
&
sqc
=
*
sqcs
.
at
(
idx
);
if
(
sqc
.
need_report
()
&&
!
fast_sqc
)
{
ObPxInitSqcResultMsg
pkt
;
pkt
.
dfo_id_
=
sqc
.
get_dfo_id
();
pkt
.
sqc_id_
=
sqc
.
get_sqc_id
();
pkt
.
rc_
=
resp
.
rc_
;
pkt
.
task_count_
=
resp
.
reserved_thread_count_
;
if
(
resp
.
reserved_thread_count_
<
sqc
.
get_max_task_count
())
{
LOG_INFO
(
"SQC do not have enough thread, Downgraded thread allocation"
,
K
(
resp
),
K
(
sqc
));
}
if
(
OB_FAIL
(
pkt
.
partitions_info_
.
assign
(
resp
.
partitions_info_
)))
{
LOG_WARN
(
"Failed to assign partition info"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
proc_
.
on_sqc_init_msg
(
exec_ctx
,
pkt
)))
{
LOG_WARN
(
"fail to do sqc init callback"
,
K
(
resp
),
K
(
pkt
),
K
(
ret
));
}
else
{
const
ObArray
<
ObSqcAsyncCB
*>&
callbacks
=
proxy
.
get_callbacks
();
ARRAY_FOREACH
(
callbacks
,
idx
)
{
const
ObSqcAsyncCB
*
cb
=
callbacks
.
at
(
idx
);
const
ObPxRpcInitSqcResponse
&
resp
=
(
*
cb
).
get_result
();
ObPxSqcMeta
&
sqc
=
*
sqcs
.
at
(
idx
);
sqc
.
set_need_report
(
true
);
if
(
!
fast_sqc
)
{
ObPxInitSqcResultMsg
pkt
;
pkt
.
dfo_id_
=
sqc
.
get_dfo_id
();
pkt
.
sqc_id_
=
sqc
.
get_sqc_id
();
pkt
.
rc_
=
resp
.
rc_
;
pkt
.
task_count_
=
resp
.
reserved_thread_count_
;
if
(
resp
.
reserved_thread_count_
<
sqc
.
get_max_task_count
())
{
LOG_INFO
(
"SQC do not have enough thread, Downgraded thread allocation"
,
K
(
resp
),
K
(
sqc
));
}
if
(
OB_FAIL
(
pkt
.
partitions_info_
.
assign
(
resp
.
partitions_info_
)))
{
LOG_WARN
(
"Failed to assign partition info"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
proc_
.
on_sqc_init_msg
(
exec_ctx
,
pkt
)))
{
LOG_WARN
(
"fail to do sqc init callback"
,
K
(
resp
),
K
(
pkt
),
K
(
ret
));
}
}
}
}
if
(
saved_ret
!=
OB_SUCCESS
)
{
ret
=
saved_ret
;
}
return
ret
;
}
...
...
src/sql/engine/px/ob_px_rpc_processor.cpp
浏览文件 @
f2b3572e
...
...
@@ -75,6 +75,17 @@ int ObInitSqcP::process()
}
else
{
/*do nothing*/
}
if
(
OB_FAIL
(
ret
)
&&
OB_NOT_NULL
(
sqc_handler
))
{
if
(
unregister_interrupt_
)
{
ObPxRpcInitSqcArgs
&
arg
=
sqc_handler
->
get_sqc_init_arg
();
UNSET_INTERRUPTABLE
(
arg
.
sqc_
.
get_interrupt_id
().
px_interrupt_id_
);
unregister_interrupt_
=
false
;
}
ObPxSqcHandler
::
release_handler
(
sqc_handler
);
arg_
.
sqc_handler_
=
nullptr
;
}
// 非rpc框架的错误内容设置到response消息中
// rpc框架的错误码在process中返回OB_SUCCESS
result_
.
rc_
=
ret
;
// return value by result_.rc_
return
OB_SUCCESS
;
...
...
@@ -137,17 +148,21 @@ int ObInitSqcP::after_process()
ret
=
startup_normal_sqc
(
*
sqc_handler
);
}
/**
* clear interrupt
*/
if
(
unregister_interrupt_
)
{
ObPxRpcInitSqcArgs
&
arg
=
sqc_handler
->
get_sqc_init_arg
();
UNSET_INTERRUPTABLE
(
arg
.
sqc_
.
get_interrupt_id
().
px_interrupt_id_
);
if
(
!
no_need_startup_normal_sqc
)
{
if
(
unregister_interrupt_
)
{
if
(
OB_ISNULL
(
sqc_handler
=
arg_
.
sqc_handler_
)
||
!
sqc_handler
->
valid
())
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"Invalid sqc handler"
,
K
(
ret
),
KPC
(
sqc_handler
));
}
else
{
ObPxRpcInitSqcArgs
&
arg
=
sqc_handler
->
get_sqc_init_arg
();
UNSET_INTERRUPTABLE
(
arg
.
sqc_
.
get_interrupt_id
().
px_interrupt_id_
);
}
}
ObPxSqcHandler
::
release_handler
(
sqc_handler
);
arg_
.
sqc_handler_
=
nullptr
;
}
ObPxSqcHandler
::
release_handler
(
sqc_handler
);
arg_
.
sqc_handler_
=
nullptr
;
return
ret
;
}
...
...
src/sql/engine/px/ob_px_sqc_async_proxy.cpp
浏览文件 @
f2b3572e
...
...
@@ -200,7 +200,6 @@ int ObPxSqcAsyncProxy::wait_all()
}
else
{
results_
.
at
(
idx
)
=
&
cb_result
;
}
sqcs_
.
at
(
idx
)
->
set_need_report
(
true
);
}
else
{
// RPC framework error, need no retry
ret
=
callback
.
get_ret_code
().
rcode_
;
...
...
@@ -273,10 +272,6 @@ void ObPxSqcAsyncProxy::fail_process()
LOG_DEBUG
(
"async sql fails, wait all callbacks"
,
K
(
return_cb_count_
),
K
(
callbacks_
.
count
()));
callback
.
set_visited
(
true
);
}
// same condition with ObPxSqcAsyncProxy::wait_all().
if
(
callback
.
get_ret_code
().
rcode_
==
OB_SUCCESS
&&
callback
.
is_processed
())
{
sqcs_
.
at
(
idx
)
->
set_need_report
(
true
);
}
}
}
cond_
.
wait_us
(
500
);
...
...
src/sql/engine/px/ob_px_worker.cpp
浏览文件 @
f2b3572e
...
...
@@ -261,6 +261,7 @@ int ObPxThreadWorker::run_at(ObPxRpcInitTaskArgs& task_arg, omt::ObPxPool& px_po
if
(
OB_SUCCESS
!=
tmp_ret
)
{
LOG_WARN
(
"fail increase thread count. abort!"
,
K
(
tmp_ret
),
K
(
ret
));
ret
=
tmp_ret
;
break
;
}
}
usleep
(
5000
);
...
...
src/sql/ob_result_set.cpp
浏览文件 @
f2b3572e
...
...
@@ -1096,6 +1096,19 @@ int ObResultSet::init_cmd_exec_context(ObExecContext& exec_ctx)
return
ret
;
}
void
ObResultSet
::
refresh_location_cache
(
ObTaskExecutorCtx
&
task_exec_ctx
,
bool
is_nonblock
,
int
err
)
{
if
(
OB_NOT_MASTER
==
err
||
OB_PARTITION_NOT_EXIST
==
err
||
is_server_down_error
(
err
))
{
int
err2
=
ObTaskExecutorCtxUtil
::
refresh_location_cache
(
task_exec_ctx
,
is_nonblock
);
if
(
OB_SUCCESS
!=
err2
)
{
LOG_WARN
(
"fail to refresh location cache"
,
K
(
err2
),
K
(
is_nonblock
),
K
(
err
));
}
LOG_TRACE
(
"partition change or not master or no response, refresh location cache"
,
K
(
err
));
}
}
// obmp_query中重试整个SQL之前,可能需要调用本接口来刷新Location,以避免总是发给了错误的服务器
int
ObResultSet
::
refresh_location_cache
(
bool
is_nonblock
)
{
return
ObTaskExecutorCtxUtil
::
refresh_location_cache
(
get_exec_context
().
get_task_exec_ctx
(),
is_nonblock
);
...
...
src/sql/ob_result_set.h
浏览文件 @
f2b3572e
...
...
@@ -188,6 +188,7 @@ public:
stmt
::
StmtType
get_inner_stmt_type
()
const
;
stmt
::
StmtType
get_literal_stmt_type
()
const
;
int64_t
get_query_string_id
()
const
;
static
void
refresh_location_cache
(
ObTaskExecutorCtx
&
task_exec_ctx
,
bool
is_nonblock
,
int
err
);
int
refresh_location_cache
(
bool
is_nonblock
);
int
check_and_nonblock_refresh_location_cache
();
bool
need_execute_remote_sql_async
()
const
...
...
src/sql/resolver/expr/ob_raw_expr_printer.cpp
浏览文件 @
f2b3572e
...
...
@@ -1240,12 +1240,13 @@ int ObRawExprPrinter::print(ObSysFunRawExpr* expr)
break
;
}
case
T_FUN_SYS_LNNVL
:
{
DATA_PRINTF
(
"%.*s"
,
LEN_AND_PTR
(
func_name
));
DATA_PRINTF
(
"
(
%.*s"
,
LEN_AND_PTR
(
func_name
));
if
(
1
!=
expr
->
get_param_count
())
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"param count should be equal 1"
,
K
(
ret
),
K
(
expr
->
get_param_count
()));
}
else
{
PRINT_EXPR
(
expr
->
get_param_expr
(
0
));
DATA_PRINTF
(
")"
);
}
break
;
}
...
...
src/sql/resolver/expr/ob_raw_expr_resolver_impl.cpp
浏览文件 @
f2b3572e
...
...
@@ -3390,6 +3390,7 @@ int ObRawExprResolverImpl::process_lnnvl_node(const ParseNode* node, ObRawExpr*&
switch
(
param_type
)
{
case
T_FUN_SYS_LNNVL
:
case
T_FUN_SYS_REGEXP_LIKE
:
case
T_OP_EXISTS
:
case
T_OP_IS
:
case
T_OP_IS_NOT
:
case
T_OP_LIKE
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录