Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
293e2ec4
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
293e2ec4
编写于
3月 15, 2022
作者:
X
xs0
提交者:
LINGuanRen
3月 15, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix coverity of transaction
上级
3427f970
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
5536 addition
and
21 deletion
+5536
-21
h0416
h0416
+5500
-0
src/storage/transaction/ob_trans_ctx.h
src/storage/transaction/ob_trans_ctx.h
+4
-2
src/storage/transaction/ob_trans_part_ctx.cpp
src/storage/transaction/ob_trans_part_ctx.cpp
+2
-2
src/storage/transaction/ob_trans_partition_stat.cpp
src/storage/transaction/ob_trans_partition_stat.cpp
+5
-0
src/storage/transaction/ob_trans_partition_stat.h
src/storage/transaction/ob_trans_partition_stat.h
+2
-1
src/storage/transaction/ob_trans_result_info_mgr.cpp
src/storage/transaction/ob_trans_result_info_mgr.cpp
+1
-0
src/storage/transaction/ob_trans_result_info_mgr.h
src/storage/transaction/ob_trans_result_info_mgr.h
+12
-6
src/storage/transaction/ob_trans_sche_ctx.cpp
src/storage/transaction/ob_trans_sche_ctx.cpp
+7
-7
src/storage/transaction/ob_trans_service.cpp
src/storage/transaction/ob_trans_service.cpp
+1
-1
src/storage/transaction/ob_trans_slave_ctx.cpp
src/storage/transaction/ob_trans_slave_ctx.cpp
+2
-2
未找到文件。
h0416
0 → 100644
浏览文件 @
293e2ec4
此差异已折叠。
点击以展开。
src/storage/transaction/ob_trans_ctx.h
浏览文件 @
293e2ec4
...
...
@@ -140,7 +140,8 @@ public:
// For Example: If you change the signature of the function `commit` in
// `ObTransCtx`, you should also modify the signature of function `commit` in
// `ObPartTransCtx`, `ObSlaveTransCtx`, `ObScheTransCtx` and `ObCoordTransCtx`
class
ObTransCtx
:
public
TransCtxHashValue
{
class
ObTransCtx
:
public
TransCtxHashValue
{
friend
class
CtxLock
;
protected:
...
...
@@ -183,6 +184,7 @@ public:
part_trans_action_
(
ObPartTransAction
::
UNKNOWN
),
trans_audit_record_
(
NULL
),
pending_callback_param_
(
common
::
OB_SUCCESS
),
elr_prepared_state_
(
ELRState
::
ELR_INIT
),
p_mt_ctx_
(
NULL
),
replay_clear_clog_ts_
(
0
),
is_dup_table_trans_
(
false
),
...
...
@@ -381,7 +383,7 @@ public:
virtual
int
leader_active
(
const
storage
::
LeaderActiveArg
&
arg
)
=
0
;
virtual
int
leader_revoke
(
const
bool
first_check
,
bool
&
need_release
,
ObEndTransCallbackArray
&
cb_array
)
=
0
;
virtual
bool
can_be_freezed
()
const
=
0
;
virtual
int
commit
(
const
bool
is_rollback
,
sql
::
ObIEndTransCallback
*
cb
,
bool
is_readonly
,
virtual
int
commit
(
const
bool
is_rollback
,
sql
::
ObIEndTransCallback
*
cb
,
const
bool
is_readonly
,
const
MonotonicTs
commit_time
,
const
int64_t
stmt_expired_time
,
const
ObStmtRollbackInfo
&
stmt_rollback_info
,
const
common
::
ObString
&
app_trace_info
,
bool
&
need_convert_to_dist_trans
)
=
0
;
virtual
void
set_exiting_
();
...
...
src/storage/transaction/ob_trans_part_ctx.cpp
浏览文件 @
293e2ec4
...
...
@@ -1440,8 +1440,8 @@ int ObPartTransCtx::handle_timeout(const int64_t delay)
REC_TRANS_TRACE_EXT
(
tlog_
,
handle_timeout
,
OB_ID
(
ret
),
ret
,
OB_ID
(
used
),
timeguard
,
OB_ID
(
uref
),
get_uref
());
}
else
{
TRANS_LOG
(
WARN
,
"failed to acquire lock in specified time"
,
K_
(
trans_id
));
unregister_timeout_task_
();
register_timeout_task_
(
delay
);
(
void
)
unregister_timeout_task_
();
(
void
)
register_timeout_task_
(
delay
);
}
return
ret
;
...
...
src/storage/transaction/ob_trans_partition_stat.cpp
浏览文件 @
293e2ec4
...
...
@@ -30,6 +30,11 @@ void ObTransPartitionStat::reset()
active_memstore_version_
.
reset
();
total_ctx_count_
=
0
;
mgr_addr_
=
0
;
with_dependency_trx_count_
=
0
;
without_dependency_trx_count_
=
0
;
end_trans_by_prev_count_
=
0
;
end_trans_by_checkpoint_count_
=
0
;
end_trans_by_self_count_
=
0
;
}
// don't valid input arguments
...
...
src/storage/transaction/ob_trans_partition_stat.h
浏览文件 @
293e2ec4
...
...
@@ -18,7 +18,8 @@
namespace
oceanbase
{
namespace
transaction
{
class
ObTransPartitionStat
{
class
ObTransPartitionStat
{
public:
ObTransPartitionStat
()
{
...
...
src/storage/transaction/ob_trans_result_info_mgr.cpp
浏览文件 @
293e2ec4
...
...
@@ -87,6 +87,7 @@ void ObTransResultInfo::reset()
state_
=
ObTransResultState
::
INVALID
;
commit_version_
=
0
;
min_log_id_
=
UINT64_MAX
;
min_log_ts_
=
INT64_MAX
;
trans_id_
.
reset
();
next_
=
NULL
;
prev_
=
NULL
;
...
...
src/storage/transaction/ob_trans_result_info_mgr.h
浏览文件 @
293e2ec4
...
...
@@ -24,7 +24,8 @@ class ObPartitionService;
namespace
transaction
{
class
ObTransResultInfoFactory
;
class
ObTransResultInfoLinkNode
{
class
ObTransResultInfoLinkNode
{
public:
ObTransResultInfoLinkNode
()
{
...
...
@@ -56,7 +57,8 @@ protected:
ObTransResultInfoLinkNode
*
prev_
;
};
class
ObTransResultInfo
:
public
ObTransResultInfoLinkNode
{
class
ObTransResultInfo
:
public
ObTransResultInfoLinkNode
{
public:
ObTransResultInfo
()
{
...
...
@@ -129,7 +131,8 @@ private:
ObTransID
trans_id_
;
};
class
ObGetMinLogIdFunction
{
class
ObGetMinLogIdFunction
{
public:
ObGetMinLogIdFunction
()
:
min_log_id_
(
UINT64_MAX
),
min_log_ts_
(
INT64_MAX
)
{}
...
...
@@ -157,7 +160,8 @@ private:
int64_t
min_log_ts_
;
};
class
ObITransResultInfoMgr
{
class
ObITransResultInfoMgr
{
public:
ObITransResultInfoMgr
()
{}
...
...
@@ -173,7 +177,8 @@ public:
virtual
int
del
(
const
ObTransID
&
trans_id
)
=
0
;
};
struct
ObTransResultInfoBucketHeader
{
struct
ObTransResultInfoBucketHeader
{
ObTransResultInfoBucketHeader
()
{
reset
();
...
...
@@ -196,7 +201,8 @@ struct ObTransResultInfoBucketHeader {
common
::
SpinRWLock
lock_
;
}
CACHE_ALIGNED
;
class
ObTransResultInfoMgr
:
public
ObITransResultInfoMgr
{
class
ObTransResultInfoMgr
:
public
ObITransResultInfoMgr
{
public:
ObTransResultInfoMgr
()
{
...
...
src/storage/transaction/ob_trans_sche_ctx.cpp
浏览文件 @
293e2ec4
...
...
@@ -560,8 +560,8 @@ int ObScheTransCtx::handle_timeout(const int64_t delay)
REC_TRANS_TRACE_EXT
(
tlog_
,
handle_timeout
,
OB_ID
(
ret
),
ret
,
OB_ID
(
uref
),
get_uref
());
}
else
{
TRANS_LOG
(
WARN
,
"failed to acquire lock in specified time"
,
K_
(
trans_id
));
unregister_timeout_task_
();
register_timeout_task_
(
delay
);
(
void
)
unregister_timeout_task_
();
(
void
)
register_timeout_task_
(
delay
);
}
return
ret
;
...
...
@@ -707,7 +707,7 @@ int ObScheTransCtx::end_trans(const ObTransDesc& trans_desc, const bool is_rollb
}
}
if
(
OB_SUCC
(
ret
))
{
set_app_trace_info_
(
trans_desc
.
get_trace_info
().
get_app_trace_info
());
(
void
)
set_app_trace_info_
(
trans_desc
.
get_trace_info
().
get_app_trace_info
());
set_stc_
(
commit_time
);
//(void)check_inner_table_commit_();
if
(
OB_FAIL
(
end_trans_
(
is_rollback
,
trans_expired_time
,
stmt_expired_time
,
need_callback
)))
{
...
...
@@ -2479,7 +2479,7 @@ int ObScheTransCtx::handle_err_response(const int64_t msg_type, const ObPartitio
trans_2pc_timeout_
=
ObServerConfig
::
get_instance
().
trx_2pc_retry_interval
;
if
(
timeout_task_
.
is_registered
())
{
(
void
)
unregister_timeout_task_
();
register_timeout_task_
(
trans_2pc_timeout_
);
(
void
)
register_timeout_task_
(
trans_2pc_timeout_
);
}
}
}
else
if
(
OB_TRANS_CLEAR_REQUEST
==
msg_type
)
{
...
...
@@ -2616,7 +2616,7 @@ int ObScheTransCtx::handle_xa_trans_response_(const int64_t msg_type, int status
TRANS_LOG
(
WARN
,
"[XA] xa prepare failed"
,
K
(
ret
),
K
(
status
),
"context"
,
*
this
);
is_rollback_
=
true
;
is_xa_end_trans_
=
true
;
register_timeout_task_
(
trans_2pc_timeout_
);
(
void
)
register_timeout_task_
(
trans_2pc_timeout_
);
status
=
OB_TRANS_NEED_ROLLBACK
;
end_trans_callback_
(
is_rollback_
,
status
);
}
else
if
(
ObXATransState
::
PREPARED
==
xa_trans_state_
)
{
...
...
@@ -3084,14 +3084,14 @@ int ObScheTransCtx::xa_rollback_session_terminate()
*/
else
if
(
has_decided_
())
{
if
(
!
is_xa_one_phase_
)
{
//
已进入两阶段提交阶段的xa事务不再允许执行一阶段提交
//
forbit one phase commit in two phase commit
ret
=
OB_TRANS_XA_PROTO
;
TRANS_LOG
(
WARN
,
"xa trans has entered into two phase"
,
"context"
,
*
this
);
}
else
if
(
!
is_rollback_
)
{
ret
=
OB_TRANS_XA_PROTO
;
TRANS_LOG
(
WARN
,
"invalid xa trans one phase request"
,
"context"
,
*
this
);
}
else
{
//
断连接转发超时,不需要重试
//
need not retry when rollback
ret
=
OB_SUCCESS
;
}
// ret = OB_ERR_UNEXPECTED;
...
...
src/storage/transaction/ob_trans_service.cpp
浏览文件 @
293e2ec4
...
...
@@ -9321,7 +9321,7 @@ int ObTransService::revert_store_ctx_(const ObStandaloneStmtDesc& desc, const Ob
{
int
ret
=
OB_SUCCESS
;
if
(
OB_UNLIKELY
(
!
desc
.
is_valid
()
||
!
pg_key
.
is_valid
()
||
OB_ISNULL
(
part_mgr
)
))
{
if
(
OB_UNLIKELY
(
!
desc
.
is_valid
()
||
!
pg_key
.
is_valid
()))
{
TRANS_LOG
(
WARN
,
"invalid argument"
,
K
(
desc
),
K
(
pg_key
));
ret
=
OB_INVALID_ARGUMENT
;
}
else
{
...
...
src/storage/transaction/ob_trans_slave_ctx.cpp
浏览文件 @
293e2ec4
...
...
@@ -510,8 +510,8 @@ int ObSlaveTransCtx::handle_timeout(const int64_t delay)
REC_TRANS_TRACE_EXT
(
tlog_
,
handle_timeout
,
OB_ID
(
ret
),
ret
,
OB_ID
(
used
),
timeguard
,
OB_ID
(
uref
),
get_uref
());
}
else
{
TRANS_LOG
(
WARN
,
"failed to acquire lock in specified time"
,
K_
(
trans_id
));
unregister_timeout_task_
();
register_timeout_task_
(
delay
);
(
void
)
unregister_timeout_task_
();
(
void
)
register_timeout_task_
(
delay
);
}
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录