Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
soremi
oceanbase
提交
c71cd910
O
oceanbase
项目概览
soremi
/
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 搜索 >>
提交
c71cd910
编写于
11月 02, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
11月 02, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix transaction time out
上级
aa0443af
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
10 deletion
+9
-10
src/share/ob_snapshot_table_proxy.cpp
src/share/ob_snapshot_table_proxy.cpp
+7
-7
src/share/ob_snapshot_table_proxy.h
src/share/ob_snapshot_table_proxy.h
+2
-3
未找到文件。
src/share/ob_snapshot_table_proxy.cpp
浏览文件 @
c71cd910
...
...
@@ -175,6 +175,7 @@ int ObSnapshotTableProxy::batch_add_snapshot(
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid arguments"
,
K
(
ret
),
K
(
tenant_id
),
K
(
schema_version
),
K
(
snapshot_version
),
K
(
tablet_id_array
));
}
else
{
int64_t
snapshot_gc_scn
=
0
;
int64_t
report_idx
=
0
;
const
int64_t
exec_tenant_id
=
ObSchemaUtils
::
get_exec_tenant_id
(
tenant_id
);
ObSnapshotInfo
info
;
...
...
@@ -184,6 +185,9 @@ int ObSnapshotTableProxy::batch_add_snapshot(
info
.
snapshot_ts_
=
snapshot_version
;
info
.
schema_version_
=
schema_version
;
info
.
comment_
=
comment
;
if
(
OB_FAIL
(
ObGlobalStatProxy
::
select_snapshot_gc_scn_for_update
(
trans
,
tenant_id
,
snapshot_gc_scn
)))
{
LOG_WARN
(
"fail to select gc timstamp for update"
,
KR
(
ret
),
K
(
info
),
K
(
tenant_id
));
}
while
(
OB_SUCC
(
ret
)
&&
report_idx
<
tablet_id_array
.
count
())
{
sql
.
reuse
();
columns
.
reuse
();
...
...
@@ -192,7 +196,7 @@ int ObSnapshotTableProxy::batch_add_snapshot(
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
cur_batch_cnt
;
++
i
)
{
info
.
tablet_id_
=
tablet_id_array
.
at
(
report_idx
+
i
).
id
();
dml
.
reuse
();
if
(
OB_FAIL
(
check_snapshot_valid
(
trans
,
info
.
tenant_id_
,
info
,
is_valid
)))
{
if
(
OB_FAIL
(
check_snapshot_valid
(
snapshot_gc_scn
,
info
,
is_valid
)))
{
LOG_WARN
(
"fail to check snapshot valid"
,
KR
(
ret
),
K
(
info
),
K
(
tenant_id
));
}
else
if
(
!
is_valid
)
{
ret
=
OB_SNAPSHOT_DISCARDED
;
...
...
@@ -399,19 +403,15 @@ int ObSnapshotTableProxy::get_all_snapshots(
}
int
ObSnapshotTableProxy
::
check_snapshot_valid
(
ObISQLClient
&
client
,
const
uint64_t
tenant_id
,
const
int64_t
snapshot_gc_scn
,
const
ObSnapshotInfo
&
info
,
bool
&
is_valid
)
bool
&
is_valid
)
const
{
int
ret
=
OB_SUCCESS
;
int64_t
snapshot_gc_scn
=
0
;
is_valid
=
false
;
if
(
!
info
.
is_valid
())
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
KR
(
ret
),
K
(
info
));
}
else
if
(
OB_FAIL
(
ObGlobalStatProxy
::
select_snapshot_gc_scn_for_update
(
client
,
tenant_id
,
snapshot_gc_scn
)))
{
LOG_WARN
(
"fail to select gc timstamp for update"
,
KR
(
ret
),
K
(
info
),
K
(
tenant_id
));
}
else
if
(
info
.
snapshot_ts_
<=
snapshot_gc_scn
)
{
is_valid
=
false
;
LOG_WARN
(
"invalid snapshot info"
,
KR
(
ret
),
K
(
info
),
K
(
snapshot_gc_scn
));
...
...
src/share/ob_snapshot_table_proxy.h
浏览文件 @
c71cd910
...
...
@@ -144,10 +144,9 @@ public:
int64_t
&
count
);
private:
int
gen_event_ts
(
int64_t
&
event_ts
);
int
check_snapshot_valid
(
common
::
ObISQLClient
&
client
,
const
uint64_t
tenant_id
,
int
check_snapshot_valid
(
const
int64_t
snapshot_gc_scn
,
const
ObSnapshotInfo
&
info
,
bool
&
is_valid
);
bool
&
is_valid
)
const
;
int
fill_snapshot_item
(
const
ObSnapshotInfo
&
info
,
share
::
ObDMLSqlSplicer
&
dml
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录