Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
26d446e4
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看板
You need to sign in or sign up before continuing.
提交
26d446e4
编写于
7月 21, 2021
作者:
Z
zx0
提交者:
wangzelin.wzl
7月 21, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Optimize query performance of __all_virtual_trans_stat and bugfix
上级
0d4cad40
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
58 addition
and
89 deletion
+58
-89
src/observer/virtual_table/ob_all_virtual_trans_stat.cpp
src/observer/virtual_table/ob_all_virtual_trans_stat.cpp
+5
-25
src/observer/virtual_table/ob_all_virtual_trans_stat.h
src/observer/virtual_table/ob_all_virtual_trans_stat.h
+0
-1
src/storage/memtable/mvcc/ob_mvcc_iterator.cpp
src/storage/memtable/mvcc/ob_mvcc_iterator.cpp
+14
-7
src/storage/memtable/mvcc/ob_mvcc_iterator.h
src/storage/memtable/mvcc/ob_mvcc_iterator.h
+1
-1
src/storage/transaction/ob_trans_ctx.h
src/storage/transaction/ob_trans_ctx.h
+1
-1
src/storage/transaction/ob_trans_ctx_mgr.cpp
src/storage/transaction/ob_trans_ctx_mgr.cpp
+19
-29
src/storage/transaction/ob_trans_ctx_mgr.h
src/storage/transaction/ob_trans_ctx_mgr.h
+3
-3
src/storage/transaction/ob_trans_functor.h
src/storage/transaction/ob_trans_functor.h
+7
-7
src/storage/transaction/ob_trans_part_ctx.h
src/storage/transaction/ob_trans_part_ctx.h
+1
-1
src/storage/transaction/ob_trans_service.cpp
src/storage/transaction/ob_trans_service.cpp
+4
-11
src/storage/transaction/ob_trans_service.h
src/storage/transaction/ob_trans_service.h
+2
-2
src/storage/transaction/ob_trans_slave_ctx.h
src/storage/transaction/ob_trans_slave_ctx.h
+1
-1
未找到文件。
src/observer/virtual_table/ob_all_virtual_trans_stat.cpp
浏览文件 @
26d446e4
...
@@ -51,6 +51,7 @@ void ObGVTransStat::destroy()
...
@@ -51,6 +51,7 @@ void ObGVTransStat::destroy()
int
ObGVTransStat
::
prepare_start_to_read_
()
int
ObGVTransStat
::
prepare_start_to_read_
()
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
trans_stat_iter_
.
reset
();
if
(
NULL
==
allocator_
||
NULL
==
trans_service_
)
{
if
(
NULL
==
allocator_
||
NULL
==
trans_service_
)
{
SERVER_LOG
(
WARN
,
SERVER_LOG
(
WARN
,
"invalid argument, allocator_ or trans_service_ is null"
,
"invalid argument, allocator_ or trans_service_ is null"
,
...
@@ -59,11 +60,8 @@ int ObGVTransStat::prepare_start_to_read_()
...
@@ -59,11 +60,8 @@ int ObGVTransStat::prepare_start_to_read_()
"trans_service"
,
"trans_service"
,
OB_P
(
trans_service_
));
OB_P
(
trans_service_
));
ret
=
OB_INVALID_ARGUMENT
;
ret
=
OB_INVALID_ARGUMENT
;
}
else
if
(
OB_SUCCESS
!=
(
ret
=
trans_service_
->
iterate_partition
(
partition_iter_
)))
{
}
else
if
(
OB_SUCCESS
!=
(
ret
=
trans_service_
->
iterate_trans_stat_without_partition
(
trans_stat_iter_
)))
{
TRANS_LOG
(
WARN
,
"iterate partition error"
,
K
(
ret
));
TRANS_LOG
(
WARN
,
"iterate transaction stat error"
,
K
(
ret
));
}
else
if
(
!
partition_iter_
.
is_ready
())
{
TRANS_LOG
(
WARN
,
"ObPartitionIterator is not ready"
);
ret
=
OB_ERR_UNEXPECTED
;
}
else
if
(
OB_SUCCESS
!=
(
ret
=
trans_stat_iter_
.
set_ready
()))
{
// set ready for the first count
}
else
if
(
OB_SUCCESS
!=
(
ret
=
trans_stat_iter_
.
set_ready
()))
{
// set ready for the first count
TRANS_LOG
(
WARN
,
"ObTransStatIterator set ready error"
,
K
(
ret
));
TRANS_LOG
(
WARN
,
"ObTransStatIterator set ready error"
,
K
(
ret
));
}
else
{
}
else
{
...
@@ -75,27 +73,9 @@ int ObGVTransStat::prepare_start_to_read_()
...
@@ -75,27 +73,9 @@ int ObGVTransStat::prepare_start_to_read_()
int
ObGVTransStat
::
get_next_trans_info_
(
ObTransStat
&
trans_stat
)
int
ObGVTransStat
::
get_next_trans_info_
(
ObTransStat
&
trans_stat
)
{
{
int
ret
=
OB_SUCCESS
;
ObTransStat
tmp_trans_stat
;
ObTransStat
tmp_trans_stat
;
ObPartitionKey
partition
;
bool
bool_ret
=
true
;
while
(
bool_ret
&&
OB_SUCCESS
==
ret
)
{
int
ret
=
trans_stat_iter_
.
get_next
(
tmp_trans_stat
);
if
(
OB_ITER_END
==
(
ret
=
trans_stat_iter_
.
get_next
(
tmp_trans_stat
)))
{
if
(
OB_SUCCESS
!=
(
ret
=
partition_iter_
.
get_next
(
partition
)))
{
if
(
OB_ITER_END
!=
ret
)
{
TRANS_LOG
(
WARN
,
"ObPartitionIterator get next partition error"
,
K
(
ret
));
}
}
else
{
trans_stat_iter_
.
reset
();
if
(
OB_SUCCESS
!=
(
ret
=
trans_service_
->
iterate_trans_stat
(
partition
,
trans_stat_iter_
)))
{
TRANS_LOG
(
WARN
,
"iterate transaction stat error"
,
K
(
ret
),
K
(
partition
));
}
}
}
else
{
bool_ret
=
false
;
}
}
if
(
OB_SUCC
(
ret
))
{
if
(
OB_SUCC
(
ret
))
{
trans_stat
=
tmp_trans_stat
;
trans_stat
=
tmp_trans_stat
;
...
...
src/observer/virtual_table/ob_all_virtual_trans_stat.h
浏览文件 @
26d446e4
...
@@ -101,7 +101,6 @@ private:
...
@@ -101,7 +101,6 @@ private:
private:
private:
transaction
::
ObTransService
*
trans_service_
;
transaction
::
ObTransService
*
trans_service_
;
transaction
::
ObPartitionIterator
partition_iter_
;
transaction
::
ObTransStatIterator
trans_stat_iter_
;
transaction
::
ObTransStatIterator
trans_stat_iter_
;
private:
private:
...
...
src/storage/memtable/mvcc/ob_mvcc_iterator.cpp
浏览文件 @
26d446e4
...
@@ -77,7 +77,9 @@ int ObMvccValueIterator::init(const ObIMvccCtx& ctx, const ObTransSnapInfo& snap
...
@@ -77,7 +77,9 @@ int ObMvccValueIterator::init(const ObIMvccCtx& ctx, const ObTransSnapInfo& snap
TRANS_LOG
(
WARN
,
"fail to find start pos for iterator"
,
K
(
ret
));
TRANS_LOG
(
WARN
,
"fail to find start pos for iterator"
,
K
(
ret
));
}
else
{
}
else
{
if
(
GCONF
.
enable_sql_audit
)
{
if
(
GCONF
.
enable_sql_audit
)
{
mark_trans_node_for_elr
(
snapshot_info
.
get_snapshot_version
(),
query_flag
.
is_prewarm
());
if
(
OB_SUCCESS
!=
(
ret
=
mark_trans_node_for_elr
(
snapshot_info
.
get_snapshot_version
(),
query_flag
.
is_prewarm
())))
{
//do nothing
}
}
}
// set has_read_relocated_row flag true when reading relocated row
// set has_read_relocated_row flag true when reading relocated row
if
(
value
->
is_has_relocated
())
{
if
(
value
->
is_has_relocated
())
{
...
@@ -91,24 +93,29 @@ int ObMvccValueIterator::init(const ObIMvccCtx& ctx, const ObTransSnapInfo& snap
...
@@ -91,24 +93,29 @@ int ObMvccValueIterator::init(const ObIMvccCtx& ctx, const ObTransSnapInfo& snap
return
ret
;
return
ret
;
}
}
void
ObMvccValueIterator
::
mark_trans_node_for_elr
(
const
int64_t
read_snapshot
,
const
bool
is_prewarm
)
int
ObMvccValueIterator
::
mark_trans_node_for_elr
(
const
int64_t
read_snapshot
,
const
bool
is_prewarm
)
{
{
int
ret
=
OB_SUCCESS
;
if
(
NULL
!=
version_iter_
)
{
if
(
NULL
!=
version_iter_
)
{
// do not set barrier info when transaction node is ELR node
ObMemtableCtx
*
curr_mt_ctx
=
static_cast
<
ObMemtableCtx
*>
(
const_cast
<
ObIMvccCtx
*>
(
ctx_
));
if
(
!
is_prewarm
&&
!
version_iter_
->
is_elr
())
{
transaction
::
ObTransCtx
*
trans_ctx
=
curr_mt_ctx
->
get_trans_ctx
();
version_iter_
->
clear_safe_read_barrier
();
ObMemtableCtx
*
curr_mt_ctx
=
static_cast
<
ObMemtableCtx
*>
(
const_cast
<
ObIMvccCtx
*>
(
ctx_
));
transaction
::
ObTransCtx
*
trans_ctx
=
curr_mt_ctx
->
get_trans_ctx
();
if
(
NULL
!=
trans_ctx
)
{
if
(
NULL
!=
trans_ctx
)
{
if
(
!
trans_ctx
->
is_bounded_staleness_read
()
&&
curr_mt_ctx
->
is_for_replay
())
{
if
(
!
trans_ctx
->
is_bounded_staleness_read
()
&&
curr_mt_ctx
->
is_for_replay
())
{
TRANS_LOG
(
WARN
,
"strong consistent read follower"
,
K
(
*
trans_ctx
),
K
(
ctx_
));
TRANS_LOG
(
WARN
,
"strong consistent read follower"
,
K
(
*
trans_ctx
),
K
(
ctx_
));
ret
=
OB_NOT_MASTER
;
}
}
}
// do not set barrier info when transaction node is ELR node
if
(
!
is_prewarm
&&
!
version_iter_
->
is_elr
())
{
version_iter_
->
clear_safe_read_barrier
();
if
(
NULL
!=
trans_ctx
)
{
version_iter_
->
set_safe_read_barrier
(
trans_ctx
->
is_bounded_staleness_read
());
version_iter_
->
set_safe_read_barrier
(
trans_ctx
->
is_bounded_staleness_read
());
version_iter_
->
set_inc_num
(
trans_ctx
->
get_trans_id
().
get_inc_num
());
version_iter_
->
set_inc_num
(
trans_ctx
->
get_trans_id
().
get_inc_num
());
}
}
version_iter_
->
set_snapshot_version_barrier
(
read_snapshot
);
version_iter_
->
set_snapshot_version_barrier
(
read_snapshot
);
}
}
}
}
return
ret
;
}
}
int
ObMvccValueIterator
::
find_start_pos
(
const
int64_t
read_snapshot
)
int
ObMvccValueIterator
::
find_start_pos
(
const
int64_t
read_snapshot
)
...
...
src/storage/memtable/mvcc/ob_mvcc_iterator.h
浏览文件 @
26d446e4
...
@@ -123,7 +123,7 @@ private:
...
@@ -123,7 +123,7 @@ private:
int
find_trans_node_below_version
(
const
int64_t
read_snapshot
,
const
bool
is_safe_read
);
int
find_trans_node_below_version
(
const
int64_t
read_snapshot
,
const
bool
is_safe_read
);
int
check_trans_node_readable
(
const
int64_t
read_snapshot
);
int
check_trans_node_readable
(
const
int64_t
read_snapshot
);
void
print_conflict_trace_log
();
void
print_conflict_trace_log
();
void
mark_trans_node_for_elr
(
const
int64_t
read_snapshot
,
const
bool
is_prewarm
);
int
mark_trans_node_for_elr
(
const
int64_t
read_snapshot
,
const
bool
is_prewarm
);
void
move_to_next_node
();
void
move_to_next_node
();
...
...
src/storage/transaction/ob_trans_ctx.h
浏览文件 @
26d446e4
...
@@ -593,7 +593,7 @@ public:
...
@@ -593,7 +593,7 @@ public:
class
ObDistTransCtx
:
public
ObTransCtx
{
class
ObDistTransCtx
:
public
ObTransCtx
{
friend
class
CtxLock
;
friend
class
CtxLock
;
friend
class
IterateTransStatFunctor
;
friend
class
IterateTransStatF
orKeyF
unctor
;
public:
public:
explicit
ObDistTransCtx
(
const
char
*
ctx_type_str
,
const
int64_t
ctx_type
)
explicit
ObDistTransCtx
(
const
char
*
ctx_type_str
,
const
int64_t
ctx_type
)
...
...
src/storage/transaction/ob_trans_ctx_mgr.cpp
浏览文件 @
26d446e4
...
@@ -1121,25 +1121,6 @@ void ObPartitionTransCtxMgr::reset_elr_statistic()
...
@@ -1121,25 +1121,6 @@ void ObPartitionTransCtxMgr::reset_elr_statistic()
ATOMIC_STORE
(
&
end_trans_by_self_count_
,
0
);
ATOMIC_STORE
(
&
end_trans_by_self_count_
,
0
);
}
}
int
ObPartitionTransCtxMgr
::
iterate_trans_stat
(
ObTransStatIterator
&
trans_stat_iter
)
{
int
ret
=
OB_SUCCESS
;
RLockGuard
guard
(
rwlock_
);
if
(
IS_NOT_INIT
)
{
TRANS_LOG
(
WARN
,
"ObPartitionTransCtxMgr not inited"
);
ret
=
OB_NOT_INIT
;
}
else
{
IterateTransStatFunctor
fn
(
trans_stat_iter
);
if
(
OB_FAIL
(
ctx_map_mgr_
.
foreach_ctx
(
fn
)))
{
TRANS_LOG
(
WARN
,
"for each transaction context error"
,
KR
(
ret
),
"manager"
,
*
this
);
}
}
return
ret
;
}
int
ObPartitionTransCtxMgr
::
set_last_restore_log_id
(
const
uint64_t
last_restore_log_id
)
int
ObPartitionTransCtxMgr
::
set_last_restore_log_id
(
const
uint64_t
last_restore_log_id
)
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
...
@@ -4139,26 +4120,35 @@ int ObPartTransCtxMgr::check_ctx_create_timestamp_elapsed(const ObPartitionKey&
...
@@ -4139,26 +4120,35 @@ int ObPartTransCtxMgr::check_ctx_create_timestamp_elapsed(const ObPartitionKey&
return
ret
;
return
ret
;
}
}
int
ObPartTransCtxMgr
::
iterate_trans_stat
(
const
ObPartitionKey
&
partition
,
ObTransStatIterator
&
trans_stat_iter
)
//iterate_trans_stat_without_partition achieves complete transaction information at the server level without partition
int
ObPartTransCtxMgr
::
iterate_trans_stat_without_partition
(
ObTransStatIterator
&
trans_stat_iter
)
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
Ob
PartitionTransCtxMgr
*
ctx_mgr
=
NULL
;
Ob
TimeGuard
tg
(
"ObPartTransCtxMgr iterate_trans_stat_without_partition"
,
5000000
)
;
DRWLock
::
RDLockGuard
guard
(
rwlock_
);
DRWLock
::
RDLockGuard
guard
(
rwlock_
);
if
(
IS_NOT_INIT
)
{
if
(
IS_NOT_INIT
)
{
TRANS_LOG
(
WARN
,
"ObPartTransCtxMgr not inited"
);
TRANS_LOG
(
WARN
,
"ObPartTransCtxMgr not inited"
);
ret
=
OB_NOT_INIT
;
ret
=
OB_NOT_INIT
;
}
else
if
(
OB_UNLIKELY
(
!
partition
.
is_valid
()))
{
}
else
if
(
OB_ISNULL
(
ctx_map_
))
{
TRANS_LOG
(
WARN
,
"invalid argument"
,
K
(
partition
));
TRANS_LOG
(
WARN
,
"get partition transaction context manager error"
);
ret
=
OB_INVALID_ARGUMENT
;
}
else
if
(
OB_ISNULL
(
ctx_mgr
=
get_partition_trans_ctx_mgr
(
partition
)))
{
TRANS_LOG
(
WARN
,
"get partition transaction context manager error"
,
K
(
partition
));
ret
=
OB_PARTITION_NOT_EXIST
;
ret
=
OB_PARTITION_NOT_EXIST
;
}
else
if
(
OB_FAIL
(
ctx_mgr
->
iterate_trans_stat
(
trans_stat_iter
)))
{
TRANS_LOG
(
WARN
,
"iterate transaction stat error"
,
KR
(
ret
),
K
(
partition
));
}
else
{
}
else
{
TRANS_LOG
(
DEBUG
,
"ObTransStatIterator set ready success"
,
K
(
partition
));
//Traverse 64 map memory
for
(
int
i
=
0
;
i
<
CONTEXT_MAP_COUNT
;
i
++
)
{
CtxMap
*
tmp_ctx
=
ctx_map_
+
i
;
if
(
OB_NOT_NULL
(
tmp_ctx
))
{
IterateTransStatForKeyFunctor
fn
(
trans_stat_iter
);
if
(
OB_SUCCESS
!=
(
ret
=
tmp_ctx
->
for_each
(
fn
)))
{
TRANS_LOG
(
WARN
,
"iterate transaction stat for each error"
,
KR
(
ret
));
}
}
}
}
if
(
OB_SUCCESS
==
ret
)
{
tg
.
click
();
TRANS_LOG
(
DEBUG
,
"ObTransStatIterator set ready success"
);
}
}
return
ret
;
return
ret
;
...
...
src/storage/transaction/ob_trans_ctx_mgr.h
浏览文件 @
26d446e4
...
@@ -268,7 +268,6 @@ public:
...
@@ -268,7 +268,6 @@ public:
return
ATOMIC_LOAD
(
&
end_trans_by_self_count_
);
return
ATOMIC_LOAD
(
&
end_trans_by_self_count_
);
}
}
void
reset_elr_statistic
();
void
reset_elr_statistic
();
int
iterate_trans_stat
(
ObTransStatIterator
&
trans_stat_iter
);
int
iterate_trans_lock_stat
(
ObTransLockStatIterator
&
trans_lock_stat_iter
);
int
iterate_trans_lock_stat
(
ObTransLockStatIterator
&
trans_lock_stat_iter
);
int
iterate_trans_result_info_in_TRIM
(
ObTransResultInfoStatIterator
&
iter
);
int
iterate_trans_result_info_in_TRIM
(
ObTransResultInfoStatIterator
&
iter
);
int
iterate_trans_table
(
const
uint64_t
end_log_id
,
blocksstable
::
ObMacroBlockWriter
&
writer
);
int
iterate_trans_table
(
const
uint64_t
end_log_id
,
blocksstable
::
ObMacroBlockWriter
&
writer
);
...
@@ -757,6 +756,7 @@ private:
...
@@ -757,6 +756,7 @@ private:
};
};
class
ObTransCtxMgrImpl
{
class
ObTransCtxMgrImpl
{
protected:
enum
{
CACHE_NUM
=
17313
,
CONTEXT_MAP_COUNT
=
1
<<
6
};
enum
{
CACHE_NUM
=
17313
,
CONTEXT_MAP_COUNT
=
1
<<
6
};
public:
public:
...
@@ -926,8 +926,8 @@ public:
...
@@ -926,8 +926,8 @@ public:
int
iterate_partition
(
ObPartitionIterator
&
partition_iter
);
int
iterate_partition
(
ObPartitionIterator
&
partition_iter
);
int
iterate_partition
(
ObELRStatSummary
&
elr_stat
);
int
iterate_partition
(
ObELRStatSummary
&
elr_stat
);
int
iterate_partition_mgr_stat
(
ObTransPartitionMgrStatIterator
&
partition_mgr_stat_iter
,
const
ObAddr
&
addr
);
int
iterate_partition_mgr_stat
(
ObTransPartitionMgrStatIterator
&
partition_mgr_stat_iter
,
const
ObAddr
&
addr
);
// get transaction stat iterator
by
partition
// get transaction stat iterator
without
partition
int
iterate_trans_stat
(
const
common
::
ObPartitionKey
&
partition
,
ObTransStatIterator
&
trans_stat_iter
);
int
iterate_trans_stat
_without_partition
(
ObTransStatIterator
&
trans_stat_iter
);
int
print_all_trans_ctx
(
const
common
::
ObPartitionKey
&
partition
);
int
print_all_trans_ctx
(
const
common
::
ObPartitionKey
&
partition
);
// get transaction lock stat iterator by partition
// get transaction lock stat iterator by partition
int
iterate_trans_lock_stat
(
const
common
::
ObPartitionKey
&
partition
,
ObTransLockStatIterator
&
trans_lock_stat_iter
);
int
iterate_trans_lock_stat
(
const
common
::
ObPartitionKey
&
partition
,
ObTransLockStatIterator
&
trans_lock_stat_iter
);
...
...
src/storage/transaction/ob_trans_functor.h
浏览文件 @
26d446e4
...
@@ -671,17 +671,17 @@ public:
...
@@ -671,17 +671,17 @@ public:
}
}
};
};
class
IterateTransStatFunctor
{
class
IterateTransStatF
orKeyF
unctor
{
public:
public:
explicit
IterateTransStatFunctor
(
ObTransStatIterator
&
trans_stat_iter
)
:
trans_stat_iter_
(
trans_stat_iter
)
explicit
IterateTransStatF
orKeyF
unctor
(
ObTransStatIterator
&
trans_stat_iter
)
:
trans_stat_iter_
(
trans_stat_iter
)
{}
{}
bool
operator
()(
const
ObTrans
ID
&
trans_id
,
ObTransCtx
*
ctx_base
)
bool
operator
()(
const
ObTrans
Key
&
trans_key
,
ObTransCtx
*
ctx_base
)
{
{
int
tmp_ret
=
common
::
OB_SUCCESS
;
int
tmp_ret
=
common
::
OB_SUCCESS
;
bool
bool_ret
=
false
;
bool
bool_ret
=
false
;
if
(
!
trans_
id
.
is_valid
()
||
OB_ISNULL
(
ctx_base
))
{
if
(
!
trans_
key
.
is_valid
()
||
OB_ISNULL
(
ctx_base
))
{
TRANS_LOG
(
WARN
,
"invalid argument"
,
K
(
trans_
id
),
"ctx"
,
OB_P
(
ctx_base
));
TRANS_LOG
(
WARN
,
"invalid argument"
,
K
(
trans_
key
),
"ctx"
,
OB_P
(
ctx_base
));
tmp_ret
=
OB_INVALID_ARGUMENT
;
tmp_ret
=
OB_INVALID_ARGUMENT
;
// If you encounter a situation where part_ctx has not been init yet,
// If you encounter a situation where part_ctx has not been init yet,
// skip it directly, there will be a background thread retry
// skip it directly, there will be a background thread retry
...
@@ -747,7 +747,7 @@ public:
...
@@ -747,7 +747,7 @@ public:
if
(
OB_SUCCESS
!=
(
tmp_ret
=
part_ctx
->
get_participants_copy
(
participants_arr
)))
{
if
(
OB_SUCCESS
!=
(
tmp_ret
=
part_ctx
->
get_participants_copy
(
participants_arr
)))
{
TRANS_LOG
(
WARN
,
"ObTransStat get participants copy error"
,
K
(
tmp_ret
));
TRANS_LOG
(
WARN
,
"ObTransStat get participants copy error"
,
K
(
tmp_ret
));
}
else
if
(
OB_SUCCESS
!=
(
tmp_ret
=
trans_stat
.
init
(
part_ctx
->
addr_
,
}
else
if
(
OB_SUCCESS
!=
(
tmp_ret
=
trans_stat
.
init
(
part_ctx
->
addr_
,
trans_
id
,
trans_
key
.
get_trans_id
()
,
part_ctx
->
tenant_id_
,
part_ctx
->
tenant_id_
,
part_ctx
->
is_exiting_
,
part_ctx
->
is_exiting_
,
part_ctx
->
is_readonly_
,
part_ctx
->
is_readonly_
,
...
@@ -777,7 +777,7 @@ public:
...
@@ -777,7 +777,7 @@ public:
"ObTransStat init error"
,
"ObTransStat init error"
,
K
(
tmp_ret
),
K
(
tmp_ret
),
K
(
has_decided
),
K
(
has_decided
),
K
(
trans_
id
),
K
(
trans_
key
.
get_trans_id
()
),
"addr"
,
"addr"
,
part_ctx
->
addr_
,
part_ctx
->
addr_
,
"tenant_id"
,
"tenant_id"
,
...
...
src/storage/transaction/ob_trans_part_ctx.h
浏览文件 @
26d446e4
...
@@ -89,7 +89,7 @@ private:
...
@@ -89,7 +89,7 @@ private:
// participant transaction context
// participant transaction context
class
ObPartTransCtx
:
public
ObDistTransCtx
,
public
ObTsCbTask
{
class
ObPartTransCtx
:
public
ObDistTransCtx
,
public
ObTsCbTask
{
friend
class
IterateTransStatFunctor
;
friend
class
IterateTransStatF
orKeyF
unctor
;
public:
public:
ObPartTransCtx
()
ObPartTransCtx
()
...
...
src/storage/transaction/ob_trans_service.cpp
浏览文件 @
26d446e4
...
@@ -6733,7 +6733,7 @@ int ObTransService::clear_all_ctx(const common::ObPartitionKey& partition)
...
@@ -6733,7 +6733,7 @@ int ObTransService::clear_all_ctx(const common::ObPartitionKey& partition)
return
ret
;
return
ret
;
}
}
int
ObTransService
::
iterate_trans_stat
(
const
common
::
ObPartitionKey
&
partition
,
ObTransStatIterator
&
trans_stat_iter
)
int
ObTransService
::
iterate_trans_stat
_without_partition
(
ObTransStatIterator
&
trans_stat_iter
)
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
const
int64_t
PRINT_SCHE_COUNT
=
128
;
const
int64_t
PRINT_SCHE_COUNT
=
128
;
...
@@ -6744,17 +6744,10 @@ int ObTransService::iterate_trans_stat(const common::ObPartitionKey& partition,
...
@@ -6744,17 +6744,10 @@ int ObTransService::iterate_trans_stat(const common::ObPartitionKey& partition,
}
else
if
(
OB_UNLIKELY
(
!
is_running_
))
{
}
else
if
(
OB_UNLIKELY
(
!
is_running_
))
{
TRANS_LOG
(
WARN
,
"ObTransService is not running"
);
TRANS_LOG
(
WARN
,
"ObTransService is not running"
);
ret
=
OB_NOT_RUNNING
;
ret
=
OB_NOT_RUNNING
;
}
else
if
(
!
partition
.
is_valid
())
{
TRANS_LOG
(
WARN
,
"invalid argument"
,
K
(
partition
));
ret
=
OB_INVALID_ARGUMENT
;
}
else
if
(
OB_FAIL
(
part_trans_ctx_mgr_
.
iterate_trans_stat
(
partition
,
trans_stat_iter
)))
{
TRANS_LOG
(
WARN
,
"iterate transaction stat error"
,
KR
(
ret
),
K
(
partition
));
}
else
if
(
OB_FAIL
(
slave_part_trans_ctx_mgr_
.
iterate_trans_stat
(
partition
,
trans_stat_iter
)))
{
TRANS_LOG
(
WARN
,
"iterate slave transaction stat error"
,
KR
(
ret
),
K
(
partition
));
}
else
if
(
OB_FAIL
(
trans_stat_iter
.
set_ready
()))
{
TRANS_LOG
(
WARN
,
"ObTransStatIterator set ready error"
,
KR
(
ret
),
K
(
partition
));
}
else
{
}
else
{
// do nothing
if
(
OB_FAIL
(
part_trans_ctx_mgr_
.
iterate_trans_stat_without_partition
(
trans_stat_iter
)))
{
TRANS_LOG
(
WARN
,
"iterate transaction stat error"
,
KR
(
ret
));
}
}
}
if
(
REACH_TIME_INTERVAL
(
60
*
1000
*
1000
))
{
if
(
REACH_TIME_INTERVAL
(
60
*
1000
*
1000
))
{
sche_trans_ctx_mgr_
.
print_all_ctx
(
PRINT_SCHE_COUNT
);
sche_trans_ctx_mgr_
.
print_all_ctx
(
PRINT_SCHE_COUNT
);
...
...
src/storage/transaction/ob_trans_service.h
浏览文件 @
26d446e4
...
@@ -396,8 +396,8 @@ public:
...
@@ -396,8 +396,8 @@ public:
// get partition iterator
// get partition iterator
int
iterate_partition
(
ObPartitionIterator
&
partition_iter
);
int
iterate_partition
(
ObPartitionIterator
&
partition_iter
);
int
iterate_partition_mgr_stat
(
ObTransPartitionMgrStatIterator
&
partition_mgr_stat_iter
);
int
iterate_partition_mgr_stat
(
ObTransPartitionMgrStatIterator
&
partition_mgr_stat_iter
);
// get transaction stat iterator
by
partition
// get transaction stat iterator
without
partition
int
iterate_trans_stat
(
const
common
::
ObPartitionKey
&
partition
,
ObTransStatIterator
&
trans_stat_iter
);
int
iterate_trans_stat
_without_partition
(
ObTransStatIterator
&
trans_stat_iter
);
int
print_all_trans_ctx
(
const
common
::
ObPartitionKey
&
partition
);
int
print_all_trans_ctx
(
const
common
::
ObPartitionKey
&
partition
);
// get the memory used condition of transaction module
// get the memory used condition of transaction module
int
iterate_trans_memory_stat
(
ObTransMemStatIterator
&
mem_stat_iter
);
int
iterate_trans_memory_stat
(
ObTransMemStatIterator
&
mem_stat_iter
);
...
...
src/storage/transaction/ob_trans_slave_ctx.h
浏览文件 @
26d446e4
...
@@ -40,7 +40,7 @@ class ObIPartitionGroupGuard;
...
@@ -40,7 +40,7 @@ class ObIPartitionGroupGuard;
namespace
transaction
{
namespace
transaction
{
// slave participant transaction context
// slave participant transaction context
class
ObSlaveTransCtx
:
public
ObDistTransCtx
{
class
ObSlaveTransCtx
:
public
ObDistTransCtx
{
friend
class
IterateTransStatFunctor
;
friend
class
IterateTransStatF
orKeyF
unctor
;
public:
public:
ObSlaveTransCtx
()
:
ObDistTransCtx
(
"slave_participant"
,
ObTransCtxType
::
SLAVE_PARTICIPANT
),
mt_ctx_
()
ObSlaveTransCtx
()
:
ObDistTransCtx
(
"slave_participant"
,
ObTransCtxType
::
SLAVE_PARTICIPANT
),
mt_ctx_
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录