Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
2aa1574b
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2aa1574b
编写于
7月 15, 2021
作者:
O
obdev
提交者:
wangzelin.wzl
7月 15, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cherry-pick from 3_1_x_release to 3.1_opensource_release
上级
7eb645fb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
75 addition
and
25 deletion
+75
-25
src/rootserver/ob_schema_history_recycler.cpp
src/rootserver/ob_schema_history_recycler.cpp
+14
-0
src/storage/ob_freeze_info_snapshot_mgr.cpp
src/storage/ob_freeze_info_snapshot_mgr.cpp
+16
-1
src/storage/ob_freeze_info_snapshot_mgr.h
src/storage/ob_freeze_info_snapshot_mgr.h
+45
-24
未找到文件。
src/rootserver/ob_schema_history_recycler.cpp
浏览文件 @
2aa1574b
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include "rootserver/ob_schema_history_recycler.h"
#include "rootserver/ob_schema_history_recycler.h"
#include "rootserver/ob_rs_async_rpc_proxy.h"
#include "rootserver/ob_rs_async_rpc_proxy.h"
#include "rootserver/ob_rs_event_history_table_operator.h"
#include "rootserver/ob_rs_event_history_table_operator.h"
#include "storage/ob_freeze_info_snapshot_mgr.h"
namespace
oceanbase
{
namespace
oceanbase
{
namespace
rootserver
{
namespace
rootserver
{
...
@@ -658,6 +659,19 @@ int ObSchemaHistoryRecycler::get_recycle_schema_version_by_global_stat(
...
@@ -658,6 +659,19 @@ int ObSchemaHistoryRecycler::get_recycle_schema_version_by_global_stat(
K
(
reserved_schema_version
));
K
(
reserved_schema_version
));
}
}
}
}
if
(
OB_SUCC
(
ret
))
{
int64_t
schema_version
=
0
;
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
tenant_ids
.
count
();
i
++
)
{
const
uint64_t
tenant_id
=
tenant_ids
.
at
(
i
);
if
(
OB_FAIL
(
storage
::
ObFreezeInfoMgrWrapper
::
get_instance
().
get_restore_point_min_schema_version
(
tenant_id
,
schema_version
)))
{
LOG_WARN
(
"fail to get restore point min_schema_version"
,
K
(
ret
),
K
(
tenant_id
));
}
else
if
(
INT64_MAX
!=
schema_version
&&
OB_FAIL
(
fill_recycle_schema_versions
(
tenant_id
,
schema_version
,
recycle_schema_versions
)))
{
LOG_WARN
(
"fail to fill recycle schema versions"
,
KR
(
ret
),
K
(
tenant_id
),
K
(
schema_version
));
}
}
}
}
}
return
ret
;
return
ret
;
}
}
...
...
src/storage/ob_freeze_info_snapshot_mgr.cpp
浏览文件 @
2aa1574b
...
@@ -560,7 +560,22 @@ int ObFreezeInfoSnapshotMgr::get_reserve_points(const int64_t tenant_id, const s
...
@@ -560,7 +560,22 @@ int ObFreezeInfoSnapshotMgr::get_reserve_points(const int64_t tenant_id, const s
return
ret
;
return
ret
;
}
}
int
ObFreezeInfoSnapshotMgr
::
get_latest_freeze_version
(
int64_t
&
freeze_version
)
int
ObFreezeInfoSnapshotMgr
::
get_restore_point_min_schema_version
(
const
int64_t
tenant_id
,
int64_t
&
schema_version
)
{
int
ret
=
OB_SUCCESS
;
schema_version
=
INT64_MAX
;
RLockGuard
lock_guard
(
lock_
);
ObIArray
<
ObSnapshotInfo
>
&
snapshots
=
snapshots_
[
cur_idx_
];
for
(
int64_t
i
=
0
;
i
<
snapshots
.
count
()
&&
OB_SUCC
(
ret
);
++
i
)
{
const
ObSnapshotInfo
&
snapshot
=
snapshots
.
at
(
i
);
if
(
snapshot
.
snapshot_type_
==
SNAPSHOT_FOR_RESTORE_POINT
&&
tenant_id
==
snapshot
.
tenant_id_
)
{
schema_version
=
std
::
min
(
snapshot
.
schema_version_
,
schema_version
);
}
}
return
ret
;
}
int
ObFreezeInfoSnapshotMgr
::
get_latest_freeze_version
(
int64_t
&
freeze_version
)
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
...
...
src/storage/ob_freeze_info_snapshot_mgr.h
浏览文件 @
2aa1574b
...
@@ -148,30 +148,51 @@ public:
...
@@ -148,30 +148,51 @@ public:
int64_t
get_latest_frozen_timestamp
();
int64_t
get_latest_frozen_timestamp
();
// no schema version is returned if you do not give the tenant id
// no schema version is returned if you do not give the tenant id
int
get_freeze_info_by_major_version
(
const
int64_t
major_version
,
FreezeInfoLite
&
freeze_info
);
int
get_freeze_info_by_major_version
(
const
int64_t
major_version
,
int
get_freeze_info_by_major_version
(
const
uint64_t
table_id
,
const
int64_t
major_version
,
FreezeInfo
&
freeze_info
);
FreezeInfoLite
&
freeze_info
);
int
get_freeze_info_by_major_version
(
int
get_freeze_info_by_major_version
(
const
uint64_t
table_id
,
const
int64_t
major_version
,
FreezeInfoLite
&
freeze_info
,
bool
&
is_first_major_version
);
const
int64_t
major_version
,
int
get_freeze_info_behind_major_version
(
const
int64_t
major_version
,
common
::
ObIArray
<
FreezeInfoLite
>&
freeze_infos
);
FreezeInfo
&
freeze_info
);
int
get_freeze_info_by_major_version
(
const
int64_t
major_version
,
int
get_tenant_freeze_info_by_major_version
(
FreezeInfoLite
&
freeze_info
,
const
uint64_t
tenant_id
,
const
int64_t
major_version
,
FreezeInfo
&
freeze_info
);
bool
&
is_first_major_version
);
int
get_freeze_info_behind_major_version
(
const
int64_t
major_version
,
int
get_freeze_info_by_snapshot_version
(
const
int64_t
snapshot_version
,
FreezeInfoLite
&
freeze_info
);
common
::
ObIArray
<
FreezeInfoLite
>
&
freeze_infos
);
int
get_freeze_info_by_snapshot_version
(
const
uint64_t
table_id
,
const
int64_t
snapshot_version
,
FreezeInfo
&
freeze_info
);
int
get_tenant_freeze_info_by_major_version
(
const
uint64_t
tenant_id
,
const
int64_t
major_version
,
int
get_neighbour_major_freeze
(
const
int64_t
snapshot_version
,
NeighbourFreezeInfoLite
&
info
);
FreezeInfo
&
freeze_info
);
int
get_neighbour_major_freeze
(
const
uint64_t
table_id
,
const
int64_t
snapshot_version
,
NeighbourFreezeInfo
&
info
);
int
get_freeze_info_by_snapshot_version
(
const
int64_t
snapshot_version
,
int
get_min_reserved_snapshot
(
const
common
::
ObPartitionKey
&
pkey
,
const
int64_t
merged_version
,
FreezeInfoLite
&
freeze_info
);
const
int64_t
schema_version
,
int64_t
&
snapshot_version
,
int64_t
&
backup_snapshot_version
);
int
get_freeze_info_by_snapshot_version
(
const
uint64_t
table_id
,
int
get_reserve_points
(
const
int64_t
tenant_id
,
const
share
::
ObSnapShotType
snapshot_type
,
const
int64_t
snapshot_version
,
common
::
ObIArray
<
share
::
ObSnapshotInfo
>&
restore_points
,
int64_t
&
snapshot_gc_ts
);
FreezeInfo
&
freeze_info
);
int
update_info
(
const
int64_t
snapshot_gc_ts
,
const
common
::
ObIArray
<
SchemaPair
>&
gc_schema_version
,
const
common
::
ObIArray
<
FreezeInfoLite
>&
info_list
,
const
common
::
ObIArray
<
share
::
ObSnapshotInfo
>&
snapshots
,
int
get_neighbour_major_freeze
(
const
int64_t
snapshot_version
,
const
int64_t
backup_snapshot_version
,
const
int64_t
delay_delete_snapshot_version
,
NeighbourFreezeInfoLite
&
info
);
const
int64_t
min_major_version
,
bool
&
changed
);
int
get_neighbour_major_freeze
(
const
uint64_t
table_id
,
const
int64_t
snapshot_version
,
NeighbourFreezeInfo
&
info
);
int
get_min_reserved_snapshot
(
const
common
::
ObPartitionKey
&
pkey
,
const
int64_t
merged_version
,
const
int64_t
schema_version
,
int64_t
&
snapshot_version
,
int64_t
&
backup_snapshot_version
);
int
get_reserve_points
(
const
int64_t
tenant_id
,
const
share
::
ObSnapShotType
snapshot_type
,
common
::
ObIArray
<
share
::
ObSnapshotInfo
>
&
restore_points
,
int64_t
&
snapshot_gc_ts
);
int
get_restore_point_min_schema_version
(
const
int64_t
tenant_id
,
int64_t
&
schema_version
);
int
update_info
(
const
int64_t
snapshot_gc_ts
,
const
common
::
ObIArray
<
SchemaPair
>
&
gc_schema_version
,
const
common
::
ObIArray
<
FreezeInfoLite
>
&
info_list
,
const
common
::
ObIArray
<
share
::
ObSnapshotInfo
>
&
snapshots
,
const
int64_t
backup_snapshot_version
,
const
int64_t
delay_delete_snapshot_version
,
const
int64_t
min_major_version
,
bool
&
changed
);
int64_t
get_snapshot_gc_ts
();
int64_t
get_snapshot_gc_ts
();
int
get_local_backup_snapshot_version
(
int64_t
&
backup_snapshot_version
);
int
get_local_backup_snapshot_version
(
int64_t
&
backup_snapshot_version
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录