Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大炮V587
oceanbase
提交
276a09d8
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,体验更适合开发者的 AI 搜索 >>
提交
276a09d8
编写于
3月 21, 2023
作者:
O
obdev
提交者:
ob-robot
3月 21, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updating max_commit_ts from ls to tenant level
上级
74a5f5ea
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
12 deletion
+13
-12
src/storage/tx/ob_tx_loop_worker.cpp
src/storage/tx/ob_tx_loop_worker.cpp
+12
-11
src/storage/tx/ob_tx_loop_worker.h
src/storage/tx/ob_tx_loop_worker.h
+1
-1
未找到文件。
src/storage/tx/ob_tx_loop_worker.cpp
浏览文件 @
276a09d8
...
...
@@ -111,6 +111,12 @@ void ObTxLoopWorker::run1()
(
void
)
scan_all_ls_
(
can_gc_tx
,
can_gc_retain_ctx
);
// TODO shanyan.g
// 1) We use max(max_commit_ts, gts_cache) as read snapshot,
// but now we adopt updating max_commit_ts periodly to avoid getting gts cache cost
// 2) Some time later, we will revert current modification when performance problem solved;
update_max_commit_ts_
();
time_used
=
ObTimeUtility
::
current_time
()
-
start_time_us
;
if
(
time_used
<
LOOP_INTERVAL
)
{
...
...
@@ -186,12 +192,6 @@ int ObTxLoopWorker::scan_all_ls_(bool can_tx_gc, bool can_gc_retain_ctx)
// keep alive, interval = 100ms
do_keep_alive_
(
cur_ls_ptr
,
min_start_scn
,
status
);
// TODO shanyan.g
// 1) We use max(max_commit_ts, gts_cache) as read snapshot,
// but now we adopt updating max_commit_ts periodly to avoid getting gts cache cost
// 2) Some time later, we will revert current modification when performance problem solved;
update_max_commit_ts_
(
cur_ls_ptr
);
if
(
can_gc_retain_ctx
)
{
do_retain_ctx_gc_
(
cur_ls_ptr
);
}
...
...
@@ -229,11 +229,12 @@ void ObTxLoopWorker::do_tx_gc_(ObLS *ls_ptr, SCN &min_start_scn, MinStartScnStat
UNUSED
(
ret
);
}
void
ObTxLoopWorker
::
update_max_commit_ts_
(
ObLS
*
ls_ptr
)
void
ObTxLoopWorker
::
update_max_commit_ts_
()
{
int
ret
=
OB_SUCCESS
;
SCN
snapshot
;
const
int64_t
expire_ts
=
ObClockGenerator
::
getClock
()
+
1000000
;
// 1s
ObTransService
*
txs
=
NULL
;
do
{
int64_t
n
=
ObClockGenerator
::
getClock
();
...
...
@@ -248,11 +249,11 @@ void ObTxLoopWorker::update_max_commit_ts_(ObLS *ls_ptr)
}
else
if
(
OB_UNLIKELY
(
!
snapshot
.
is_valid
()))
{
ret
=
OB_ERR_UNEXPECTED
;
TRANS_LOG
(
WARN
,
"invalid snapshot from gts"
,
K
(
snapshot
));
}
else
if
(
OB_ISNULL
(
txs
=
MTL
(
ObTransService
*
)))
{
ret
=
OB_ERR_UNEXPECTED
;
TRANS_LOG
(
ERROR
,
"unexpected transaction service"
,
K
(
ret
),
KP
(
txs
));
}
else
{
if
(
NULL
!=
ls_ptr
)
{
ls_ptr
->
get_tx_svr
()
->
get_trans_service
()
->
get_tx_version_mgr
().
update_max_commit_ts
(
snapshot
,
false
);
}
txs
->
get_tx_version_mgr
().
update_max_commit_ts
(
snapshot
,
false
);
}
}
while
(
OB_EAGAIN
==
ret
);
}
...
...
src/storage/tx/ob_tx_loop_worker.h
浏览文件 @
276a09d8
...
...
@@ -58,7 +58,7 @@ private:
int
scan_all_ls_
(
bool
can_tx_gc
,
bool
can_gc_retain_ctx
);
void
do_keep_alive_
(
ObLS
*
ls
,
const
share
::
SCN
&
min_start_scn
,
MinStartScnStatus
status
);
// 100ms
void
do_tx_gc_
(
ObLS
*
ls
,
share
::
SCN
&
min_start_scn
,
MinStartScnStatus
&
status
);
// 15s
void
update_max_commit_ts_
(
ObLS
*
ls
);
void
update_max_commit_ts_
();
void
do_retain_ctx_gc_
(
ObLS
*
ls
);
// 15s
private:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录