Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
5ff640d9
O
oceanbase
项目概览
Metz
/
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看板
提交
5ff640d9
编写于
4月 18, 2022
作者:
Q
qianchanger
提交者:
LINGuanRen
4月 18, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix px infinite retry loop in PL. && Clean up interrupt status at the beginning of the thread
上级
3cec53aa
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
33 addition
and
12 deletion
+33
-12
src/observer/ob_inner_sql_connection.cpp
src/observer/ob_inner_sql_connection.cpp
+7
-0
src/observer/omt/ob_tenant.cpp
src/observer/omt/ob_tenant.cpp
+3
-1
src/observer/omt/ob_th_worker.cpp
src/observer/omt/ob_th_worker.cpp
+1
-0
src/share/interrupt/ob_global_interrupt_call.cpp
src/share/interrupt/ob_global_interrupt_call.cpp
+8
-0
src/share/interrupt/ob_global_interrupt_call.h
src/share/interrupt/ob_global_interrupt_call.h
+12
-2
src/sql/engine/px/ob_px_admission.cpp
src/sql/engine/px/ob_px_admission.cpp
+1
-2
src/sql/ob_result_set.cpp
src/sql/ob_result_set.cpp
+1
-7
未找到文件。
src/observer/ob_inner_sql_connection.cpp
浏览文件 @
5ff640d9
...
...
@@ -474,6 +474,13 @@ int ObInnerSQLConnection::process_retry(
THIS_WORKER
.
sched_wait
();
usleep
(
static_cast
<
unsigned
int
>
(
sleep_time_us
));
THIS_WORKER
.
sched_run
();
}
else
if
(
repeatable_stmt
&&
is_scheduler_thread_not_enough_err
(
last_ret
))
{
const
int64_t
sleep_time_us
=
10
*
1000
;
// 10ms
need_retry
=
true
;
LOG_WARN
(
"scheduler thread not enough, need retry"
,
K
(
ret
),
K
(
last_ret
),
K
(
retry_cnt
));
THIS_WORKER
.
sched_wait
();
usleep
(
static_cast
<
unsigned
int
>
(
sleep_time_us
));
THIS_WORKER
.
sched_run
();
}
if
(
get_session
().
is_nested_session
())
{
/**
...
...
src/observer/omt/ob_tenant.cpp
浏览文件 @
5ff640d9
...
...
@@ -20,6 +20,7 @@
#include "lib/stat/ob_session_stat.h"
#include "share/config/ob_server_config.h"
#include "sql/engine/px/ob_px_admission.h"
#include "share/interrupt/ob_global_interrupt_call.h"
#include "ob_th_worker.h"
#include "ob_worker_pool.h"
#include "ob_multi_tenant.h"
...
...
@@ -133,8 +134,9 @@ void ObPxPool::run1()
if
(
OB_LIKELY
(
nullptr
!=
pm
))
{
pm
->
set_tenant_ctx
(
tenant_id_
,
common
::
ObCtxIds
::
WORK_AREA
);
}
CLEAR_INTERRUPTABLE
();
ObCgroupCtrl
*
cgroup_ctrl
=
GCTX
.
cgroup_ctrl_
;
LOG_INFO
(
"
XXXXX:
run px pool"
,
K
(
group_id_
),
K
(
tenant_id_
));
LOG_INFO
(
"run px pool"
,
K
(
group_id_
),
K
(
tenant_id_
));
if
(
nullptr
!=
cgroup_ctrl
&&
OB_LIKELY
(
cgroup_ctrl
->
is_valid
()))
{
pid_t
pid
=
static_cast
<
pid_t
>
(
syscall
(
__NR_gettid
));
cgroup_ctrl
->
add_thread_to_cgroup
(
tenant_id_
,
group_id_
,
pid
);
...
...
src/observer/omt/ob_th_worker.cpp
浏览文件 @
5ff640d9
...
...
@@ -392,6 +392,7 @@ void ObThWorker::worker(int64_t& tenant_id, int64_t& req_recv_timestamp, int32_t
ret
=
pm
->
set_tenant_ctx
(
tenant_
->
id
(),
ObCtxIds
::
DEFAULT_CTX_ID
);
}
}
CLEAR_INTERRUPTABLE
();
set_th_worker_thread_name
(
tenant_
->
id
());
lib
::
ContextTLOptGuard
guard
(
true
);
lib
::
ContextParam
param
;
...
...
src/share/interrupt/ob_global_interrupt_call.cpp
浏览文件 @
5ff640d9
...
...
@@ -97,6 +97,14 @@ ObGlobalInterruptManager* ObGlobalInterruptManager::getInstance()
return
instance_
;
}
void
ObInterruptChecker
::
clear_interrupt_status
()
{
if
(
ref_count_
>
0
)
{
LIB_LOG
(
ERROR
,
"invlid interrupt ref count"
);
}
interrupted_
=
false
;
}
int
ObGlobalInterruptManager
::
init
(
const
common
::
ObAddr
&
local
,
ObInterruptRpcProxy
*
rpc_proxy
)
{
int
ret
=
OB_SUCCESS
;
...
...
src/share/interrupt/ob_global_interrupt_call.h
浏览文件 @
5ff640d9
...
...
@@ -124,6 +124,7 @@ public:
void
clear_status
();
void
interrupt
(
ObInterruptCode
&
interrupt_code
);
void
clear_interrupt_status
();
private:
/*
...
...
@@ -339,7 +340,16 @@ OB_INLINE void UNSET_INTERRUPTABLE(const ObInterruptibleTaskID& tid)
}
}
}
// end namespace common
}
// end namespace oceanbase
OB_INLINE
void
CLEAR_INTERRUPTABLE
()
{
if
(
OB_ISNULL
(
get_checker
()))
{
LIB_LOG
(
ERROR
,
"interrupt checker may not be set correctly"
);
}
else
{
get_checker
()
->
clear_interrupt_status
();
}
}
}
// end namespace common
}
// end namespace oceanbase
#endif // OCEANBASE_OBSERVER_OB_REMOTE_INTERRUPT_CALL_H_
src/sql/engine/px/ob_px_admission.cpp
浏览文件 @
5ff640d9
...
...
@@ -70,8 +70,7 @@ int ObPxAdmission::enter_query_admission(
LOG_WARN
(
"fail check query status"
,
K
(
ret
));
}
else
if
(
!
ObPxAdmission
::
admit
(
req_worker_count
,
admit_worker_count
))
{
plan
.
inc_delayed_px_querys
();
THIS_WORKER
.
set_retry_flag
();
ret
=
OB_EAGAIN
;
ret
=
OB_ERR_SCHEDULER_THREAD_NOT_ENOUGH
;
LOG_INFO
(
"It's a px query, out of px worker resource, "
"need delay, do not need disconnect"
,
K
(
req_worker_count
),
...
...
src/sql/ob_result_set.cpp
浏览文件 @
5ff640d9
...
...
@@ -101,12 +101,7 @@ OB_INLINE int ObResultSet::open_plan()
if
(
OB_FAIL
(
ObPxAdmission
::
enter_query_admission
(
my_session_
,
get_exec_context
(),
*
get_physical_plan
(),
worker_count_
)))
{
// query is not admitted to run
if
(
OB_EAGAIN
==
ret
)
{
ret
=
OB_ERR_SCHEDULER_THREAD_NOT_ENOUGH
;
LOG_DEBUG
(
"Query is not admitted to run, try again"
,
K
(
ret
));
}
else
{
LOG_WARN
(
"Fail to get admission to use px"
,
K
(
ret
));
}
LOG_DEBUG
(
"Query is not admitted to run, try again"
,
K
(
ret
));
}
else
if
(
THIS_WORKER
.
is_timeout
())
{
ret
=
OB_TIMEOUT
;
LOG_WARN
(
"query is timeout"
,
...
...
@@ -1108,7 +1103,6 @@ void ObResultSet::refresh_location_cache(ObTaskExecutorCtx &task_exec_ctx, bool
}
}
// 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
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录