Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
d2f257f8
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看板
提交
d2f257f8
编写于
7月 12, 2021
作者:
O
obdev
提交者:
wangzelin.wzl
7月 12, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix iterate flag with same sql_seq
上级
4c044554
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
92 addition
and
2 deletion
+92
-2
src/storage/memtable/ob_memtable_iterator.cpp
src/storage/memtable/ob_memtable_iterator.cpp
+2
-0
src/storage/ob_row_fuse.cpp
src/storage/ob_row_fuse.cpp
+1
-0
unittest/storage/mockcontainer/mock_ob_iterator.cpp
unittest/storage/mockcontainer/mock_ob_iterator.cpp
+3
-1
unittest/storage/mockcontainer/mock_ob_iterator.h
unittest/storage/mockcontainer/mock_ob_iterator.h
+1
-1
unittest/storage/test_partition_merge_multi_version.cpp
unittest/storage/test_partition_merge_multi_version.cpp
+85
-0
未找到文件。
src/storage/memtable/ob_memtable_iterator.cpp
浏览文件 @
d2f257f8
...
...
@@ -1337,6 +1337,8 @@ int ObMemtableMultiVersionScanIterator::iterate_uncommitted_row_value_(ObStoreRo
if
(
OB_ITER_END
!=
ret
)
{
TRANS_LOG
(
WARN
,
"failed to get next uncommitted node"
,
K
(
ret
),
K
(
tnode
));
}
}
else
if
(
ObActionFlag
::
OP_DEL_ROW
==
row
.
flag_
)
{
continue
;
}
else
{
const
ObMvccTransNode
*
trans_node
=
reinterpret_cast
<
const
ObMvccTransNode
*>
(
tnode
);
if
(
OB_ISNULL
(
trans_node
))
{
...
...
src/storage/ob_row_fuse.cpp
浏览文件 @
d2f257f8
...
...
@@ -207,6 +207,7 @@ OB_INLINE static int simple_fuse_row(
nop_pos
.
reset
();
result
.
flag_
=
former
.
flag_
;
result
.
from_base_
=
former
.
from_base_
;
result
.
dml_
=
former
.
dml_
;
column_cnt
=
former
.
row_val_
.
count_
;
}
else
{
column_cnt
=
nop_pos
.
count_
;
...
...
unittest/storage/mockcontainer/mock_ob_iterator.cpp
浏览文件 @
d2f257f8
...
...
@@ -833,7 +833,9 @@ int ObMockIteratorBuilder::static_init()
OB_SUCCESS
!=
str_to_dml_
.
set_refactored
(
ObString
::
make_string
(
"DELETE"
),
T_DML_DELETE
)
||
OB_SUCCESS
!=
str_to_dml_
.
set_refactored
(
ObString
::
make_string
(
"T_DML_DELETE"
),
T_DML_DELETE
)
||
OB_SUCCESS
!=
str_to_dml_
.
set_refactored
(
ObString
::
make_string
(
"REPLACE"
),
T_DML_REPLACE
)
||
OB_SUCCESS
!=
str_to_dml_
.
set_refactored
(
ObString
::
make_string
(
"T_DML_REPLACE"
),
T_DML_REPLACE
))
{
OB_SUCCESS
!=
str_to_dml_
.
set_refactored
(
ObString
::
make_string
(
"T_DML_REPLACE"
),
T_DML_REPLACE
)
||
OB_SUCCESS
!=
str_to_dml_
.
set_refactored
(
ObString
::
make_string
(
"LOCK"
),
T_DML_LOCK
)
||
OB_SUCCESS
!=
str_to_dml_
.
set_refactored
(
ObString
::
make_string
(
"T_DML_LOCK"
),
T_DML_LOCK
))
{
ret
=
OB_INIT_FAIL
;
STORAGE_LOG
(
WARN
,
"dml hashtable insert failed"
);
}
else
{
...
...
unittest/storage/mockcontainer/mock_ob_iterator.h
浏览文件 @
d2f257f8
...
...
@@ -289,7 +289,7 @@ public:
static
const
int
TYPE_NUM
=
6
;
static
const
int
INFO_NUM
=
2
;
static
const
int
FLAG_NUM
=
5
;
static
const
int
DML_NUM
=
3
;
static
const
int
DML_NUM
=
6
;
static
const
int
BASE_NUM
=
2
;
static
const
int
MULTI_VERSION_ROW_FLAG_NUM
=
5
;
static
const
int
TRANS_ID_NUM
=
10
;
...
...
unittest/storage/test_partition_merge_multi_version.cpp
浏览文件 @
d2f257f8
...
...
@@ -3245,6 +3245,91 @@ TEST_F(TestMultiVersionMerge, test_trans_cross_sstable)
}
}
TEST_F
(
TestMultiVersionMerge
,
test_merge_with_dml
)
{
GCONF
.
_enable_sparse_row
=
false
;
ObMemtableCtxFactory
mem_ctx
;
ObSSTableMergeCtx
merge_context
;
const
int64_t
rowkey_cnt
=
TEST_ROWKEY_COLUMN_CNT
+
ObMultiVersionRowkeyHelpper
::
get_extra_rowkey_col_cnt
();
storage
::
ObTablesHandle
tables_handle
;
ObSSTable
sstable1
;
const
char
*
macro_data
[
1
];
macro_data
[
0
]
=
"bigint var bigint bigint bigint bigint dml flag multi_version_row_flag trans_id
\n
"
"1 var1 MIN -28 NOP NOP T_DML_DELETE DELETE LU trans_id_1
\n
"
"2 var2 MIN -10 NOP NOP T_DML_DELETE DELETE LU trans_id_1
\n
"
"3 var3 MIN -21 NOP NOP T_DML_LOCK EXIST LU trans_id_1
\n
"
"4 var4 MIN -71 18 28 T_DML_INSERT EXIST U trans_id_1
\n
"
"4 var4 MIN -12 NOP NOP T_DML_DELETE EXIST LU trans_id_1
\n
"
"5 var5 MIN -18 NOP NOP T_DML_LOCK EXIST LU trans_id_1
\n
"
;
prepare_data_start
(
sstable1
,
macro_data
,
rowkey_cnt
,
9
,
"none"
,
FLAT_ROW_STORE
,
0
);
prepare_one_macro
(
macro_data
,
1
);
prepare_data_end
(
sstable1
);
ASSERT_EQ
(
OB_SUCCESS
,
tables_handle
.
add_table
(
&
sstable1
));
STORAGE_LOG
(
INFO
,
"finish prepare sstable1"
);
ObSSTable
sstable2
;
const
char
*
macro_data2
[
1
];
macro_data2
[
0
]
=
"bigint var bigint bigint bigint bigint dml flag multi_version_row_flag trans_id
\n
"
"6 var6 MIN -18 NOP NOP T_DML_LOCK EXIST LU trans_id_1
\n
"
;
prepare_data_start
(
sstable2
,
macro_data2
,
rowkey_cnt
,
10
,
"none"
,
FLAT_ROW_STORE
,
0
);
prepare_one_macro
(
macro_data2
,
1
);
prepare_data_end
(
sstable2
);
ASSERT_EQ
(
OB_SUCCESS
,
tables_handle
.
add_table
(
&
sstable2
));
STORAGE_LOG
(
INFO
,
"finish prepare sstable2"
);
// make all trans running
int
ret
=
OB_SUCCESS
;
test_trans_part_ctx_
.
clear_all
();
if
(
OB_FAIL
(
test_trans_part_ctx_
.
add_transaction_status
(
transaction
::
ObTransTableStatusType
::
COMMIT
,
29
)))
{
STORAGE_LOG
(
ERROR
,
"add transaction status failed"
,
K
(
ret
));
}
ObVersionRange
trans_version_range
;
trans_version_range
.
snapshot_version_
=
100
;
trans_version_range
.
multi_version_start_
=
1
;
trans_version_range
.
base_version_
=
1
;
prepare_merge_context
(
tables_handle
,
MINI_MINOR_MERGE
,
false
,
trans_version_range
,
merge_context
);
ObMockIterator
res_iter
;
ObStoreRowIterator
*
scanner
=
NULL
;
ObExtStoreRange
range
;
const
char
*
result1
=
"bigint var bigint bigint bigint bigint dml flag multi_version_row_flag
\n
"
"1 var1 -29 -28 NOP NOP T_DML_DELETE DELETE CL
\n
"
"2 var2 -29 -10 NOP NOP T_DML_DELETE DELETE CL
\n
"
"3 var3 -29 -21 NOP NOP T_DML_LOCK EXIST CL
\n
"
"4 var4 -29 -71 18 28 T_DML_INSERT EXIST CL
\n
"
"5 var5 -29 -18 NOP NOP T_DML_LOCK EXIST CL
\n
"
"6 var6 -29 -18 NOP NOP T_DML_LOCK EXIST CL
\n
"
;
// minor mrege
ObMacroBlockBuilder
builder
;
ObSSTable
*
merged_sstable
=
nullptr
;
ASSERT_EQ
(
OB_SUCCESS
,
ObPartitionMergeUtil
::
merge_partition
(
&
mem_ctx
,
merge_context
,
builder
,
0
));
build_sstable
(
merge_context
,
merged_sstable
);
res_iter
.
reset
();
range
.
get_range
().
set_whole_range
();
prepare_query_param
(
trans_version_range
);
ASSERT_EQ
(
OB_SUCCESS
,
range
.
to_collation_free_range_on_demand_and_cutoff_range
(
allocator_
));
if
(
OB_NOT_NULL
(
merged_sstable
))
{
context_
.
read_out_type_
=
FLAT_ROW_STORE
;
ASSERT_EQ
(
OB_SUCCESS
,
merged_sstable
->
scan
(
param_
,
context_
,
range
,
scanner
));
ASSERT_EQ
(
OB_SUCCESS
,
res_iter
.
from
(
result1
));
ASSERT_TRUE
(
res_iter
.
equals
(
*
scanner
,
true
));
scanner
->~
ObStoreRowIterator
();
}
else
{
STORAGE_LOG
(
ERROR
,
"merged_sstable is null"
);
}
}
}
// namespace storage
}
// namespace oceanbase
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录