Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
245b8b7a
O
oceanbase
项目概览
oceanbase
/
oceanbase
8 个月 前同步成功
通知
260
Star
6084
Fork
1301
代码
文件
提交
分支
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,体验更适合开发者的 AI 搜索 >>
提交
245b8b7a
编写于
1月 04, 2022
作者:
B
bf0
提交者:
LINGuanRen
1月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix mysqltest
上级
e68621cd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
58 addition
and
9 deletion
+58
-9
src/sql/engine/cmd/ob_load_data_impl.cpp
src/sql/engine/cmd/ob_load_data_impl.cpp
+58
-9
未找到文件。
src/sql/engine/cmd/ob_load_data_impl.cpp
浏览文件 @
245b8b7a
...
...
@@ -808,11 +808,29 @@ int ObLoadDataBase::memory_wait_local(ObExecContext &ctx,
leader_addr
.
reset
();
res
.
reuse
();
bool
force_renew
=
false
;
do
{
const
int64_t
retry_us
=
200
*
1000
;
if
(
OB_FAIL
(
ObLoadDataUtils
::
check_session_status
(
*
session
)))
{
LOG_WARN
(
"session is not valid during wait"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
loc_cache
->
get_strong_leader
(
part_key
,
leader_addr
,
force_renew
)))
{
LOG_WARN
(
"get partition location cache failed"
,
K
(
ret
),
K
(
part_key
));
if
(
OB_FAIL
(
ObLoadDataUtils
::
check_session_status
(
*
session
)))
{
LOG_WARN
(
"session is not valid during wait"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
loc_cache
->
get_strong_leader
(
part_key
,
leader_addr
,
force_renew
)))
{
if
(
OB_LOCATION_LEADER_NOT_EXIST
==
ret
&&
!
force_renew
)
{
// retry one time
force_renew
=
true
;
LOG_WARN
(
"failed to get location and force renew"
,
K
(
ret
),
K
(
part_key
));
}
else
{
LOG_WARN
(
"failed to get location"
,
K
(
ret
),
K
(
part_key
));
usleep
(
retry_us
);
}
}
else
{
force_renew
=
false
;
LOG_DEBUG
(
"get participants"
,
K
(
part_key
),
K
(
leader_addr
));
}
}
while
(
OB_LOCATION_LEADER_NOT_EXIST
==
ret
&&
force_renew
);
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
OB_FAIL
(
sql
.
assign_fmt
(
SERVER_TENANT_MEMORY_EXAMINE_SQL
,
tenant_id
,
(
leader_addr
.
get_ipv4
()
>>
24
)
&
0XFF
,
...
...
@@ -1079,10 +1097,31 @@ int ObLoadDataImpl::send_and_switch_buffer(
ObAddr
leader_addr
;
if
(
OB_FAIL
(
part_key
.
init
(
load_args_
.
table_id_
,
part_id
,
0
)))
{
LOG_WARN
(
"partition key init failed"
,
K
(
load_args_
.
table_id_
),
K
(
part_id
),
K
(
part_num_
));
}
else
if
(
OB_FAIL
(
partition_locatition_cache
->
get_strong_leader
(
part_key
,
leader_addr
)))
{
LOG_WARN
(
"get partition location cache failed"
,
K
(
ret
),
K
(
part_key
));
}
else
{
// async rpc call send used buffer
bool
force_renew
=
false
;
do
{
const
int64_t
retry_us
=
200
*
1000
;
if
(
OB_FAIL
(
ObLoadDataUtils
::
check_session_status
(
*
ctx
.
get_my_session
())))
{
LOG_WARN
(
"session is not valid during wait"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
partition_locatition_cache
->
get_strong_leader
(
part_key
,
leader_addr
,
force_renew
)))
{
if
(
OB_LOCATION_LEADER_NOT_EXIST
==
ret
&&
!
force_renew
)
{
// retry one time
force_renew
=
true
;
LOG_WARN
(
"failed to get location and force renew"
,
K
(
ret
),
K
(
part_key
));
}
else
{
LOG_WARN
(
"failed to get location"
,
K
(
ret
),
K
(
part_key
));
usleep
(
retry_us
);
}
}
else
{
force_renew
=
false
;
LOG_DEBUG
(
"get participants"
,
K
(
part_key
),
K
(
leader_addr
));
}
}
while
(
OB_LOCATION_LEADER_NOT_EXIST
==
ret
&&
force_renew
);
}
if
(
OB_SUCC
(
ret
))
{
//async rpc call send used buffer
buffer
->
set_addr
(
leader_addr
);
ObRpcLoadDataTaskCallBack
mycallback
(
task_controller_
,
complete_task_array_
,
buffer
);
serialize_timer_
.
start_stat
();
...
...
@@ -3838,7 +3877,13 @@ void ObDataFragMgr::distory_datafrag(ObDataFrag* frag)
int
ObPartDataFragMgr
::
update_part_location
(
ObExecContext
&
ctx
)
{
int
ret
=
OB_SUCCESS
;
ObIPartitionLocationCache
*
location_cache
=
NULL
;
ObIPartitionLocationCache
*
location_cache
=
NULL
;
const
int64_t
retry_us
=
200
*
1000
;
int64_t
query_timeout
=
0
;
int64_t
retry_timeout
=
0
;
ctx
.
get_my_session
()
->
get_query_timeout
(
query_timeout
);
retry_timeout
=
std
::
min
(
ObTimeUtil
::
current_time
()
+
30
*
USECS_PER_SEC
,
// the RTO is 30s
query_timeout
);
if
(
OB_UNLIKELY
(
!
part_key_
.
is_valid
()))
{
ret
=
OB_NOT_INIT
;
...
...
@@ -3855,8 +3900,12 @@ int ObPartDataFragMgr::update_part_location(ObExecContext& ctx)
force_renew
=
true
;
LOG_WARN
(
"failed to get location and force renew"
,
K
(
ret
),
K
(
part_key_
));
}
else
{
force_renew
=
false
;
LOG_WARN
(
"failed to get location"
,
K
(
ret
),
K
(
part_key_
));
if
(
ObTimeUtil
::
current_time
()
+
retry_us
>
retry_timeout
)
{
force_renew
=
false
;
}
else
{
usleep
(
retry_us
);
}
}
}
else
{
LOG_DEBUG
(
"get participants"
,
K
(
part_key_
),
K
(
leader_addr_
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录