Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lihongda1002
oceanbase
提交
d28594a8
O
oceanbase
项目概览
lihongda1002
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d28594a8
编写于
11月 04, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
11月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add barrier snapshot version for defensive check【4377】
上级
c259349b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
7 deletion
+27
-7
src/storage/memtable/mvcc/ob_mvcc_acc_ctx.h
src/storage/memtable/mvcc/ob_mvcc_acc_ctx.h
+9
-6
src/storage/memtable/mvcc/ob_mvcc_iterator.cpp
src/storage/memtable/mvcc/ob_mvcc_iterator.cpp
+11
-0
src/storage/memtable/ob_memtable_context.cpp
src/storage/memtable/ob_memtable_context.cpp
+5
-0
src/storage/tx/ob_trans_service_v4.cpp
src/storage/tx/ob_trans_service_v4.cpp
+2
-1
未找到文件。
src/storage/memtable/mvcc/ob_mvcc_acc_ctx.h
浏览文件 @
d28594a8
...
...
@@ -78,7 +78,8 @@ public:
}
bool
is_valid
()
const
{
switch
(
type_
)
{
case
T
::
READ
:
return
is_read_valid__
();
case
T
::
STRONG_READ
:
return
is_read_valid__
();
case
T
::
WEAK_READ
:
return
is_read_valid__
();
case
T
::
WRITE
:
return
is_write_valid__
();
case
T
::
REPLAY
:
return
is_replay_valid__
();
default:
return
false
;
...
...
@@ -109,10 +110,11 @@ public:
const
storage
::
ObTxTableGuard
&
tx_table_guard
,
const
transaction
::
ObTxSnapshot
&
snapshot
,
const
int64_t
abs_lock_timeout
,
const
int64_t
tx_lock_timeout
)
const
int64_t
tx_lock_timeout
,
const
bool
is_weak_read
)
{
reset
();
type_
=
T
::
READ
;
type_
=
is_weak_read
?
T
::
WEAK_READ
:
T
::
STRONG_
READ
;
tx_ctx_
=
tx_ctx
;
mem_ctx_
=
mem_ctx
;
tx_table_guard_
=
tx_table_guard
;
...
...
@@ -128,7 +130,7 @@ public:
{
transaction
::
ObTxSnapshot
snapshot
;
snapshot
.
version_
=
snapshot_version
;
init_read
(
NULL
,
NULL
,
tx_table_guard
,
snapshot
,
timeout
,
tx_lock_timeout
);
init_read
(
NULL
,
NULL
,
tx_table_guard
,
snapshot
,
timeout
,
tx_lock_timeout
,
false
);
}
void
init_write
(
transaction
::
ObPartTransCtx
&
tx_ctx
,
ObMemtableCtx
&
mem_ctx
,
...
...
@@ -177,7 +179,8 @@ public:
ObMemtableCtx
*
get_mem_ctx
()
const
{
return
mem_ctx_
;
}
bool
is_read
()
const
{
return
type_
==
T
::
READ
;
}
bool
is_read
()
const
{
return
type_
==
T
::
STRONG_READ
||
type_
==
T
::
WEAK_READ
;
}
bool
is_weak_read
()
const
{
return
type_
==
T
::
WEAK_READ
;
}
bool
is_write
()
const
{
return
type_
==
T
::
WRITE
;
}
bool
is_replay
()
const
{
return
type_
==
T
::
REPLAY
;
}
int64_t
eval_lock_expire_ts
(
int64_t
lock_wait_start_ts
=
0
)
const
{
...
...
@@ -212,7 +215,7 @@ public:
private:
void
warn_tx_ctx_leaky_
();
public:
// NOTE: those field should only be accessed by txn relative routine
enum
class
T
{
INVL
,
READ
,
WRITE
,
REPLAY
}
type_
;
enum
class
T
{
INVL
,
STRONG_READ
,
WEAK_
READ
,
WRITE
,
REPLAY
}
type_
;
// abs_lock_timeout is calculated from the minimum of the wait time of the
// select_for_update and timeout in dml_param / scan_param
int64_t
abs_lock_timeout_
;
...
...
src/storage/memtable/mvcc/ob_mvcc_iterator.cpp
浏览文件 @
d28594a8
...
...
@@ -90,6 +90,17 @@ int ObMvccValueIterator::lock_for_read_(const ObQueryFlag &flag)
}
}
// add barrier snapshot version for defensive check
if
(
NULL
!=
version_iter_
)
{
if
(
ctx_
->
is_weak_read
())
{
version_iter_
->
set_safe_read_barrier
(
ctx_
->
snapshot_
.
version_
);
}
if
(
!
flag
.
is_prewarm
()
&&
!
version_iter_
->
is_elr
())
{
version_iter_
->
set_snapshot_version_barrier
(
ctx_
->
snapshot_
.
version_
);
}
}
lock_for_read_end
(
lock_start_time
,
ret
);
return
ret
;
}
...
...
src/storage/memtable/ob_memtable_context.cpp
浏览文件 @
d28594a8
...
...
@@ -457,6 +457,11 @@ int ObMemtableCtx::trans_end(
{
int
ret
=
OB_SUCCESS
;
if
(
commit
&&
INT64_MAX
==
get_trans_version
())
{
TRANS_LOG
(
ERROR
,
"unexpected prepare version"
,
K
(
*
this
));
// no retcode
}
ret
=
do_trans_end
(
commit
,
trans_version
,
final_log_ts
,
...
...
src/storage/tx/ob_trans_service_v4.cpp
浏览文件 @
d28594a8
...
...
@@ -936,7 +936,8 @@ int ObTransService::get_read_store_ctx(const ObTxReadSnapshot &snapshot,
tx_table_guard
,
snapshot
.
core_
,
store_ctx
.
timeout_
,
lock_timeout
lock_timeout
,
snapshot
.
is_weak_read
()
);
update_max_read_ts_
(
tenant_id_
,
ls_id
,
snapshot
.
core_
.
version_
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录