Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大炮V587
oceanbase
提交
5d895552
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,发现更多精彩内容 >>
提交
5d895552
编写于
12月 05, 2022
作者:
G
godyangfight
提交者:
ob-robot
1月 12, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix restore start scn changed smaller then logical sstable and cannot find right table bug
上级
5c7339fe
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
57 deletion
+29
-57
src/storage/ls/ob_ls_tablet_service.cpp
src/storage/ls/ob_ls_tablet_service.cpp
+15
-46
src/storage/tablet/ob_tablet_table_store.cpp
src/storage/tablet/ob_tablet_table_store.cpp
+14
-11
未找到文件。
src/storage/ls/ob_ls_tablet_service.cpp
浏览文件 @
5d895552
...
...
@@ -1974,12 +1974,18 @@ int ObLSTabletService::get_read_tables(
int
ret
=
OB_SUCCESS
;
ObTabletHandle
&
handle
=
iter
.
tablet_handle_
;
iter
.
reset
();
AllowToReadMgr
::
AllowToReadInfo
read_info
;
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
),
K_
(
is_inited
));
}
else
if
(
OB_UNLIKELY
(
!
tablet_id
.
is_valid
()
||
snapshot_version
<
0
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid arguments"
,
K
(
ret
),
K
(
tablet_id
),
K
(
snapshot_version
));
}
else
if
(
FALSE_IT
(
allow_to_read_mgr_
.
load_allow_to_read_info
(
read_info
)))
{
}
else
if
(
!
read_info
.
allow_to_read
())
{
ret
=
OB_REPLICA_NOT_READABLE
;
LOG_WARN
(
"ls is not allow to read"
,
K
(
ret
),
KPC
(
ls_
));
}
else
if
(
OB_FAIL
(
check_and_get_tablet
(
tablet_id
,
handle
)))
{
LOG_WARN
(
"fail to check and get tablet"
,
K
(
ret
),
K
(
tablet_id
));
}
else
if
(
OB_UNLIKELY
(
!
handle
.
is_valid
()))
{
...
...
@@ -1989,6 +1995,13 @@ int ObLSTabletService::get_read_tables(
allow_no_ready_read
)))
{
LOG_WARN
(
"fail to get read tables"
,
K
(
ret
),
K
(
handle
),
K
(
tablet_id
),
K
(
snapshot_version
),
K
(
iter
),
K
(
allow_no_ready_read
));
}
else
{
bool
is_same
=
false
;
allow_to_read_mgr_
.
check_read_info_same
(
read_info
,
is_same
);
if
(
!
is_same
)
{
ret
=
OB_REPLICA_NOT_READABLE
;
LOG_WARN
(
"ls is not allow to read"
,
K
(
ret
),
KPC
(
ls_
));
}
}
return
ret
;
}
...
...
@@ -5033,15 +5046,10 @@ int ObLSTabletService::get_multi_ranges_cost(
int
ret
=
OB_SUCCESS
;
ObTabletTableIterator
iter
;
const
int64_t
max_snapshot_version
=
INT64_MAX
;
AllowToReadMgr
::
AllowToReadInfo
read_info
;
if
(
IS_NOT_INIT
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
));
}
else
if
(
FALSE_IT
(
allow_to_read_mgr_
.
load_allow_to_read_info
(
read_info
)))
{
}
else
if
(
!
read_info
.
allow_to_read
())
{
ret
=
OB_REPLICA_NOT_READABLE
;
LOG_WARN
(
"ls is not allow to read"
,
K
(
ret
),
KPC
(
ls_
));
}
else
if
(
OB_FAIL
(
get_read_tables
(
tablet_id
,
max_snapshot_version
,
iter
)))
{
LOG_WARN
(
"fail to get all read tables"
,
K
(
ret
),
K
(
tablet_id
),
K
(
max_snapshot_version
));
}
else
{
...
...
@@ -5067,15 +5075,10 @@ int ObLSTabletService::split_multi_ranges(
int
ret
=
OB_SUCCESS
;
ObTabletTableIterator
iter
;
const
int64_t
max_snapshot_version
=
INT64_MAX
;
AllowToReadMgr
::
AllowToReadInfo
read_info
;
if
(
IS_NOT_INIT
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
));
}
else
if
(
FALSE_IT
(
allow_to_read_mgr_
.
load_allow_to_read_info
(
read_info
)))
{
}
else
if
(
!
read_info
.
allow_to_read
())
{
ret
=
OB_REPLICA_NOT_READABLE
;
LOG_WARN
(
"ls is not allow to read"
,
K
(
ret
),
KPC
(
ls_
));
}
else
if
(
OB_FAIL
(
get_read_tables
(
tablet_id
,
max_snapshot_version
,
iter
)))
{
LOG_WARN
(
"fail to get all read tables"
,
K
(
ret
),
K
(
tablet_id
),
K
(
max_snapshot_version
));
}
else
{
...
...
@@ -5091,14 +5094,6 @@ int ObLSTabletService::split_multi_ranges(
}
}
if
(
OB_SUCC
(
ret
))
{
bool
is_same
=
false
;
allow_to_read_mgr_
.
check_read_info_same
(
read_info
,
is_same
);
if
(
!
is_same
)
{
ret
=
OB_REPLICA_NOT_READABLE
;
LOG_WARN
(
"ls is not allow to read"
,
K
(
ret
),
KPC
(
ls_
));
}
}
return
ret
;
}
...
...
@@ -5113,7 +5108,6 @@ int ObLSTabletService::estimate_row_count(
ObPartitionEst
batch_est
;
ObTabletTableIterator
tablet_iter
;
common
::
ObSEArray
<
ObITable
*
,
4
>
tables
;
AllowToReadMgr
::
AllowToReadInfo
read_info
;
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
...
...
@@ -5122,10 +5116,6 @@ int ObLSTabletService::estimate_row_count(
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
),
K
(
scan_range
));
}
else
if
(
scan_range
.
is_empty
())
{
}
else
if
(
FALSE_IT
(
allow_to_read_mgr_
.
load_allow_to_read_info
(
read_info
)))
{
}
else
if
(
!
read_info
.
allow_to_read
())
{
ret
=
OB_REPLICA_NOT_READABLE
;
LOG_WARN
(
"ls is not allow to read"
,
K
(
ret
),
KPC
(
ls_
));
}
else
{
const
int64_t
snapshot_version
=
-
1
==
param
.
frozen_version_
?
GET_BATCH_ROWS_READ_SNAPSHOT_VERSION
:
param
.
frozen_version_
;
...
...
@@ -5164,15 +5154,8 @@ int ObLSTabletService::estimate_row_count(
}
}
if
(
OB_SUCC
(
ret
))
{
bool
is_same
=
false
;
allow_to_read_mgr_
.
check_read_info_same
(
read_info
,
is_same
);
if
(
!
is_same
)
{
ret
=
OB_REPLICA_NOT_READABLE
;
LOG_WARN
(
"ls is not allow to read"
,
K
(
ret
),
KPC
(
ls_
));
}
else
{
logical_row_count
=
batch_est
.
logical_row_count_
;
physical_row_count
=
batch_est
.
physical_row_count_
;
}
logical_row_count
=
batch_est
.
logical_row_count_
;
physical_row_count
=
batch_est
.
physical_row_count_
;
}
LOG_DEBUG
(
"estimate result"
,
K
(
ret
),
K
(
batch_est
),
K
(
est_records
));
return
ret
;
...
...
@@ -5187,15 +5170,10 @@ int ObLSTabletService::estimate_block_count(
macro_block_count
=
0
;
micro_block_count
=
0
;
ObTabletTableIterator
tablet_iter
;
AllowToReadMgr
::
AllowToReadInfo
read_info
;
if
(
IS_NOT_INIT
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
),
K_
(
is_inited
));
}
else
if
(
FALSE_IT
(
allow_to_read_mgr_
.
load_allow_to_read_info
(
read_info
)))
{
}
else
if
(
!
read_info
.
allow_to_read
())
{
ret
=
OB_REPLICA_NOT_READABLE
;
LOG_WARN
(
"ls is not allow to read"
,
K
(
ret
),
KPC
(
ls_
));
}
else
if
(
OB_FAIL
(
get_read_tables
(
tablet_id
,
INT64_MAX
,
tablet_iter
,
false
/*allow_no_ready_read*/
)))
{
LOG_WARN
(
"failed to get read tables"
,
K
(
ret
));
}
...
...
@@ -5230,15 +5208,6 @@ int ObLSTabletService::estimate_block_count(
}
}
}
if
(
OB_SUCC
(
ret
))
{
bool
is_same
=
false
;
allow_to_read_mgr_
.
check_read_info_same
(
read_info
,
is_same
);
if
(
!
is_same
)
{
ret
=
OB_REPLICA_NOT_READABLE
;
LOG_WARN
(
"ls is not allow to read"
,
K
(
ret
),
KPC
(
ls_
));
}
}
return
ret
;
}
...
...
src/storage/tablet/ob_tablet_table_store.cpp
浏览文件 @
5d895552
...
...
@@ -1681,26 +1681,24 @@ int ObTabletTableStore::update_ha_minor_sstables_(
LOG_INFO
(
"start scn is bigger than clog checkpoint ts, no need keep local minor sstable"
,
K
(
old_store
));
}
else
{
int64_t
index
=
0
;
bool
found
=
false
;
bool
has_remote_logical_sstable
=
false
;
for
(
int64_t
i
=
0
;
i
<
old_minor_tables
.
count_
;
++
i
)
{
const
ObITable
*
table
=
old_minor_tables
[
i
];
if
(
table
->
get_start_scn
()
<=
param
.
start_scn_
&&
table
->
get_end_scn
()
>
param
.
start_scn_
)
{
if
(
table
->
is_remote_logical_minor_sstable
())
{
has_remote_logical_sstable
=
true
;
index
=
i
;
found
=
true
;
break
;
}
}
if
(
!
found
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"No minor sstable inlcude start scn"
,
K
(
ret
),
K
(
old_store
));
}
else
{
if
(
has_remote_logical_sstable
)
{
ObITable
*
table
=
old_minor_tables
[
index
];
if
(
OB_ISNULL
(
table
)
||
!
table
->
is
_minor_sstable
())
{
if
(
!
table
->
is_remote_logical
_minor_sstable
())
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"table should not be NULL or table type is not minor sstable"
,
K
(
ret
),
KP
(
table
),
K
(
old_store
));
}
else
if
(
!
table
->
is_remote_logical_minor_sstable
())
{
//do nothing
LOG_WARN
(
"table type is unexpected"
,
K
(
ret
),
KPC
(
table
),
K
(
old_store
),
K
(
param
));
}
else
if
(
param
.
start_scn_
>=
table
->
get_end_scn
())
{
//no need remote logical sstable
index
=
index
+
1
;
}
else
{
ObSSTable
*
sstable
=
static_cast
<
ObSSTable
*>
(
table
);
share
::
ObScnRange
new_scn_range
;
...
...
@@ -1710,11 +1708,16 @@ int ObTabletTableStore::update_ha_minor_sstables_(
sstable
->
set_scn_range
(
new_scn_range
);
LOG_INFO
(
"cut ha remote logical sstable log ts range"
,
KPC
(
sstable
),
K
(
new_scn_range
),
K
(
original_scn_range
));
}
}
else
{
//local minor sstable contain param.start_scn, reuse local sstable
//index = 0
}
if
(
OB_SUCC
(
ret
))
{
if
(
OB_FAIL
(
old_minor_tables
.
get_all_tables
(
new_minor_tables
)))
{
LOG_WARN
(
"failed to get all minor tables"
,
K
(
ret
),
K
(
old_minor_tables
));
}
else
if
(
index
>=
new_minor_tables
.
count
())
{
//reuse nothing, copy from src
}
else
if
(
OB_FAIL
(
minor_tables_
.
init_and_copy
(
allocator
,
new_minor_tables
,
index
)))
{
LOG_WARN
(
"failed to init minor_tables"
,
K
(
ret
),
K
(
new_minor_tables
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录