Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大炮V587
oceanbase
提交
b4219874
O
oceanbase
项目概览
大炮V587
/
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,发现更多精彩内容 >>
提交
b4219874
编写于
12月 08, 2022
作者:
O
obdev
提交者:
ob-robot
1月 12, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix concurrent problem of px target monitor
上级
ea4e6498
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
17 addition
and
5 deletion
+17
-5
src/sql/engine/px/ob_px_tenant_target_monitor.cpp
src/sql/engine/px/ob_px_tenant_target_monitor.cpp
+11
-3
src/sql/optimizer/ob_px_resource_analyzer.cpp
src/sql/optimizer/ob_px_resource_analyzer.cpp
+6
-2
未找到文件。
src/sql/engine/px/ob_px_tenant_target_monitor.cpp
浏览文件 @
b4219874
...
...
@@ -315,6 +315,11 @@ int ObPxTenantTargetMonitor::update_peer_target_used(const ObAddr &server, int64
{
int
ret
=
OB_SUCCESS
;
ServerTargetUsage
target_usage
;
if
(
OB_FAIL
(
global_target_usage_
.
get_refactored
(
server
,
target_usage
)))
{
if
(
ret
!=
OB_HASH_NOT_EXIST
)
{
LOG_WARN
(
"get refactored failed"
,
K
(
ret
));
}
else
{
ObLockGuard
<
ObSpinLock
>
lock_guard
(
spin_lock_
);
if
(
OB_FAIL
(
global_target_usage_
.
get_refactored
(
server
,
target_usage
)))
{
if
(
ret
!=
OB_HASH_NOT_EXIST
)
{
LOG_WARN
(
"get refactored failed"
,
K
(
ret
));
...
...
@@ -324,6 +329,8 @@ int ObPxTenantTargetMonitor::update_peer_target_used(const ObAddr &server, int64
LOG_WARN
(
"set refactored failed"
,
K
(
ret
));
}
}
}
}
}
else
{
auto
update_peer_used
=
[
=
](
hash
::
HashMapPair
<
ObAddr
,
ServerTargetUsage
>
&
entry
)
->
void
{
if
(
is_leader
())
{
...
...
@@ -361,6 +368,7 @@ int ObPxTenantTargetMonitor::get_global_target_usage(const hash::ObHashMap<ObAdd
int
ObPxTenantTargetMonitor
::
reset_statistics
(
uint64_t
version
)
{
int
ret
=
OB_SUCCESS
;
ObLockGuard
<
ObSpinLock
>
lock_guard
(
spin_lock_
);
global_target_usage_
.
clear
();
if
(
OB_FAIL
(
global_target_usage_
.
set_refactored
(
server_
,
ServerTargetUsage
())))
{
LOG_WARN
(
"set refactored failed"
,
K
(
ret
));
...
...
src/sql/optimizer/ob_px_resource_analyzer.cpp
浏览文件 @
b4219874
...
...
@@ -593,7 +593,10 @@ int ObPxResourceAnalyzer::schedule_dfo(
const
int64_t
group
=
1
;
groups
+=
group
;
ObHashSet
<
ObAddr
>
&
addr_set
=
dfo
.
location_addr_
;
if
(
OB_FAIL
(
update_parallel_map
(
current_thread_map
,
addr_set
,
dfo
.
get_dop
())))
{
// we assume that should allocate same thread count for each sqc in the dfo.
// this may not true. but we can't decide the real count for each sqc. just let it be for now
const
int64_t
dop_per_addr
=
0
==
addr_set
.
size
()
?
dfo
.
get_dop
()
:
(
dfo
.
get_dop
()
+
addr_set
.
size
()
-
1
)
/
addr_set
.
size
();
if
(
OB_FAIL
(
update_parallel_map
(
current_thread_map
,
addr_set
,
dop_per_addr
)))
{
LOG_WARN
(
"increase current thread map failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
update_parallel_map
(
current_group_map
,
addr_set
,
group
)))
{
LOG_WARN
(
"increase current group map failed"
,
K
(
ret
));
...
...
@@ -616,7 +619,8 @@ int ObPxResourceAnalyzer::finish_dfo(
const
int64_t
group
=
1
;
groups
-=
group
;
ObHashSet
<
ObAddr
>
&
addr_set
=
dfo
.
location_addr_
;
if
(
OB_FAIL
(
update_parallel_map
(
current_thread_map
,
addr_set
,
-
dfo
.
get_dop
())))
{
const
int64_t
dop_per_addr
=
0
==
addr_set
.
size
()
?
dfo
.
get_dop
()
:
(
dfo
.
get_dop
()
+
addr_set
.
size
()
-
1
)
/
addr_set
.
size
();
if
(
OB_FAIL
(
update_parallel_map
(
current_thread_map
,
addr_set
,
-
dop_per_addr
)))
{
LOG_WARN
(
"decrease current thread map failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
update_parallel_map
(
current_group_map
,
addr_set
,
-
group
)))
{
LOG_WARN
(
"decrease current group map failed"
,
K
(
ret
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录