Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大炮V587
oceanbase
提交
a11ae17d
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,发现更多精彩内容 >>
提交
a11ae17d
编写于
3月 14, 2023
作者:
O
obdev
提交者:
ob-robot
3月 14, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rewrite ret code for bug/48008983
上级
8cd738a4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
21 deletion
+40
-21
src/observer/virtual_table/ob_all_virtual_tx_stat.cpp
src/observer/virtual_table/ob_all_virtual_tx_stat.cpp
+5
-1
src/storage/tx/ob_trans_ctx_mgr_v4.cpp
src/storage/tx/ob_trans_ctx_mgr_v4.cpp
+4
-0
src/storage/tx/ob_trans_functor.h
src/storage/tx/ob_trans_functor.h
+31
-20
未找到文件。
src/observer/virtual_table/ob_all_virtual_tx_stat.cpp
浏览文件 @
a11ae17d
...
...
@@ -59,12 +59,16 @@ int ObGVTxStat::prepare_start_to_read_()
}
else
if
(
OB_SUCCESS
!=
(
ret
=
fill_tenant_ids_
()))
{
SERVER_LOG
(
WARN
,
"fail to fill tenant ids"
,
K
(
ret
));
}
else
{
for
(
int
i
=
0
;
i
<
all_tenants_
.
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
all_tenants_
.
count
()
&&
OB_SUCC
(
ret
)
;
i
++
)
{
int64_t
cur_tenant_id
=
all_tenants_
.
at
(
i
);
MTL_SWITCH
(
cur_tenant_id
)
{
transaction
::
ObTransService
*
txs
=
MTL
(
transaction
::
ObTransService
*
);
if
(
OB_SUCCESS
!=
(
ret
=
txs
->
iterate_all_observer_tx_stat
(
tx_stat_iter_
)))
{
SERVER_LOG
(
WARN
,
"iterate transaction stat error"
,
K
(
ret
),
K
(
cur_tenant_id
));
// when interate tenant failed, show all info collected, not need return error code
if
(
OB_NOT_RUNNING
==
ret
||
OB_NOT_INIT
==
ret
)
{
ret
=
OB_SUCCESS
;
}
}
}
}
...
...
src/storage/tx/ob_trans_ctx_mgr_v4.cpp
浏览文件 @
a11ae17d
...
...
@@ -1151,6 +1151,8 @@ int ObLSTxCtxMgr::iterate_tx_ctx_stat(ObTxStatIterator &tx_stat_iter)
}
else
{
IterateTxStatFunctor
fn
(
tx_stat_iter
);
if
(
OB_FAIL
(
ls_tx_ctx_map_
.
for_each
(
fn
)))
{
// rewrite eagain to real ret
ret
=
fn
.
get_ret
();
TRANS_LOG
(
WARN
,
"for each transaction context error"
,
KR
(
ret
),
"manager"
,
*
this
);
}
}
...
...
@@ -1878,6 +1880,8 @@ int ObTxCtxMgr::iterate_all_observer_tx_stat(ObTxStatIterator &tx_stat_iter)
}
else
{
IterateAllLSTxStatFunctor
fn
(
tx_stat_iter
);
if
(
OB_FAIL
(
foreach_ls_
(
fn
)))
{
// rewrite eagain to real ret code
ret
=
fn
.
get_ret
();
TRANS_LOG
(
WARN
,
"foreach_ls_ tx_stat error"
,
KR
(
ret
));
}
else
{
// do nothing
...
...
src/storage/tx/ob_trans_functor.h
浏览文件 @
a11ae17d
...
...
@@ -691,31 +691,37 @@ private:
class
IterateAllLSTxStatFunctor
{
public:
explicit
IterateAllLSTxStatFunctor
(
ObTxStatIterator
&
tx_stat_iter
)
:
tx_stat_iter_
(
tx_stat_iter
)
{}
explicit
IterateAllLSTxStatFunctor
(
ObTxStatIterator
&
tx_stat_iter
)
:
tx_stat_iter_
(
tx_stat_iter
),
ret_
(
OB_SUCCESS
)
{}
bool
operator
()(
ObLSTxCtxMgr
*
ls_tx_ctx_mgr
)
{
int
tmp_
ret
=
common
::
OB_SUCCESS
;
int
ret
=
common
::
OB_SUCCESS
;
bool
bool_ret
=
false
;
if
(
OB_ISNULL
(
ls_tx_ctx_mgr
))
{
tmp_
ret
=
OB_INVALID_ARGUMENT
;
TRANS_LOG_RET
(
WARN
,
tmp_
ret
,
"invalid argument"
,
KP
(
ls_tx_ctx_mgr
));
ret
=
OB_INVALID_ARGUMENT
;
TRANS_LOG_RET
(
WARN
,
ret
,
"invalid argument"
,
KP
(
ls_tx_ctx_mgr
));
}
else
{
const
share
::
ObLSID
&
ls_id
=
ls_tx_ctx_mgr
->
get_ls_id
();
if
(
!
ls_id
.
is_valid
())
{
tmp_
ret
=
OB_INVALID_ARGUMENT
;
TRANS_LOG_RET
(
WARN
,
tmp_
ret
,
"invalid ls id"
,
K
(
ls_id
),
KP
(
ls_tx_ctx_mgr
));
}
else
if
(
OB_
TMP_
FAIL
(
ls_tx_ctx_mgr
->
iterate_tx_ctx_stat
(
tx_stat_iter_
)))
{
TRANS_LOG_RET
(
WARN
,
tmp_ret
,
"iterate_tx_ctx_stat error"
,
K
(
tmp_
ret
),
K
(
ls_id
));
ret
=
OB_INVALID_ARGUMENT
;
TRANS_LOG_RET
(
WARN
,
ret
,
"invalid ls id"
,
K
(
ls_id
),
KP
(
ls_tx_ctx_mgr
));
}
else
if
(
OB_FAIL
(
ls_tx_ctx_mgr
->
iterate_tx_ctx_stat
(
tx_stat_iter_
)))
{
TRANS_LOG_RET
(
WARN
,
ret
,
"iterate_tx_ctx_stat error"
,
K
(
ret
),
K
(
ls_id
));
}
else
{
bool_ret
=
true
;
}
}
if
(
OB_FAIL
(
ret
))
{
ret_
=
ret
;
}
return
bool_ret
;
}
int
get_ret
()
const
{
return
ret_
;
}
private:
ObTxStatIterator
&
tx_stat_iter_
;
int
ret_
;
};
class
IteratorTxIDFunctor
...
...
@@ -749,15 +755,16 @@ private:
class
IterateTxStatFunctor
{
public:
explicit
IterateTxStatFunctor
(
ObTxStatIterator
&
tx_stat_iter
)
:
tx_stat_iter_
(
tx_stat_iter
)
{}
explicit
IterateTxStatFunctor
(
ObTxStatIterator
&
tx_stat_iter
)
:
tx_stat_iter_
(
tx_stat_iter
),
ret_
(
OB_SUCCESS
){}
OPERATOR_V4
(
IterateTxStatFunctor
)
{
int
tmp_
ret
=
common
::
OB_SUCCESS
;
int
ret
=
common
::
OB_SUCCESS
;
bool
bool_ret
=
false
;
if
(
!
tx_id
.
is_valid
()
||
OB_ISNULL
(
tx_ctx
))
{
tmp_
ret
=
OB_INVALID_ARGUMENT
;
TRANS_LOG_RET
(
WARN
,
tmp_
ret
,
"invalid argument"
,
K
(
tx_id
),
"ctx"
,
OB_P
(
tx_ctx
));
ret
=
OB_INVALID_ARGUMENT
;
TRANS_LOG_RET
(
WARN
,
ret
,
"invalid argument"
,
K
(
tx_id
),
"ctx"
,
OB_P
(
tx_ctx
));
// If you encounter a situation where tx_ctx has not been init yet,
// skip it directly, there will be a background thread retry
}
else
if
(
!
tx_ctx
->
is_inited
())
{
...
...
@@ -773,11 +780,11 @@ public:
// If the transaction has not completed in 600 seconds, print its trace log
tx_ctx
->
print_trace_log
();
}
if
(
OB_SUCC
ESS
==
tmp_ret
)
{
if
(
OB_SUCC
(
ret
)
)
{
share
::
ObLSArray
participants_arr
;
if
(
OB_
TMP_
FAIL
(
tx_ctx
->
get_2pc_participants_copy
(
participants_arr
)))
{
TRANS_LOG_RET
(
WARN
,
tmp_ret
,
"ObTxStat get participants copy error"
,
K
(
tmp_
ret
));
}
else
if
(
OB_
TMP_
FAIL
(
tx_stat
.
init
(
tx_ctx
->
addr_
,
if
(
OB_FAIL
(
tx_ctx
->
get_2pc_participants_copy
(
participants_arr
)))
{
TRANS_LOG_RET
(
WARN
,
ret
,
"ObTxStat get participants copy error"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
tx_stat
.
init
(
tx_ctx
->
addr_
,
tx_id
,
tx_ctx
->
tenant_id_
,
has_decided
,
...
...
@@ -801,22 +808,26 @@ public:
tx_ctx
->
exec_info_
.
xid_
,
tx_ctx
->
exec_info_
.
upstream_
,
tx_ctx
->
last_request_ts_
)))
{
TRANS_LOG_RET
(
WARN
,
tmp_ret
,
"ObTxStat init error"
,
K
(
tmp_
ret
),
KPC
(
tx_ctx
));
}
else
if
(
OB_
TMP_
FAIL
(
tx_stat_iter_
.
push
(
tx_stat
)))
{
TRANS_LOG_RET
(
WARN
,
tmp_ret
,
"ObTxStatIterator push trans stat error"
,
K
(
tmp_
ret
));
TRANS_LOG_RET
(
WARN
,
ret
,
"ObTxStat init error"
,
K
(
ret
),
KPC
(
tx_ctx
));
}
else
if
(
OB_FAIL
(
tx_stat_iter_
.
push
(
tx_stat
)))
{
TRANS_LOG_RET
(
WARN
,
ret
,
"ObTxStatIterator push trans stat error"
,
K
(
ret
));
}
else
{
// do nothing
}
}
}
if
(
OB_SUCC
ESS
==
tmp_ret
)
{
if
(
OB_SUCC
(
ret
)
)
{
bool_ret
=
true
;
}
else
{
ret_
=
ret
;
}
return
bool_ret
;
}
int
get_ret
()
const
{
return
ret_
;
}
private:
ObTxStatIterator
&
tx_stat_iter_
;
int
ret_
;
};
class
GetRecLogTSFunctor
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录