Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
3ad80b7d
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,发现更多精彩内容 >>
提交
3ad80b7d
编写于
9月 23, 2021
作者:
Y
yy0
提交者:
wangzelin.wzl
9月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix rebuild partition left at INIT state
上级
f51c7afe
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
4 addition
and
42 deletion
+4
-42
src/storage/ob_partition_migrator.cpp
src/storage/ob_partition_migrator.cpp
+1
-1
src/storage/ob_partition_service.cpp
src/storage/ob_partition_service.cpp
+3
-39
src/storage/ob_partition_service.h
src/storage/ob_partition_service.h
+0
-2
未找到文件。
src/storage/ob_partition_migrator.cpp
浏览文件 @
3ad80b7d
...
...
@@ -8300,7 +8300,7 @@ int ObMigrateUtil::enable_replay_with_new_partition(ObMigrateCtx& ctx)
LOG_WARN("partition should not be null", K(ret));
} else if (OB_FAIL(partition->create_memtable())) {
LOG_WARN("failed to create memtable", K(ret), "pkey", partition->get_partition_key());
} else if (OB_FAIL(ObPartitionService::get_instance().
log_new_partition(partition
,
} else if (OB_FAIL(ObPartitionService::get_instance().
online_partition(partition->get_partition_key()
,
ctx.pg_meta_.storage_info_.get_data_info().get_publish_version(),
ctx.pg_meta_.restore_snapshot_version_,
ctx.pg_meta_.last_restore_log_id_,
...
...
src/storage/ob_partition_service.cpp
浏览文件 @
3ad80b7d
...
...
@@ -1433,45 +1433,7 @@ int ObPartitionService::add_new_partition(ObIPartitionGroupGuard& partition_guar
return ret;
}
int ObPartitionService::log_new_partition(ObIPartitionGroup* partition, const int64_t publish_version,
const int64_t restore_snapshot_version, const uint64_t last_restore_log_id, const int64_t last_restore_log_ts)
{
int ret = OB_SUCCESS;
if (OB_UNLIKELY(!is_inited_)) {
ret = OB_NOT_INIT;
STORAGE_LOG(WARN, "partition service is not initialized", K(ret));
} else if (OB_ISNULL(partition) || publish_version < 0) {
ret = OB_INVALID_ARGUMENT;
STORAGE_LOG(WARN, "invalid argument", K(partition), K(publish_version), K(ret));
} else {
const ObPartitionKey pkey = partition->get_partition_key();
if (OB_FAIL(txs_->add_partition(pkey))) {
STORAGE_LOG(WARN, "add new partition to transaction service failed", K(ret), K(pkey));
} else if (OB_FAIL(txs_->update_publish_version(pkey, publish_version, true))) {
STORAGE_LOG(WARN, "update publish version failed", K(pkey), K(publish_version));
} else if (OB_FAIL(txs_->update_restore_replay_info(
pkey, restore_snapshot_version, last_restore_log_id, last_restore_log_ts))) {
STORAGE_LOG(WARN,
"failed to update_restore_replay_info",
K(restore_snapshot_version),
K(last_restore_log_id),
K(last_restore_log_ts),
K(ret));
} else if (OB_FAIL(rp_eg_->add_partition(pkey))) {
STORAGE_LOG(WARN, "replay engine add partition failed", K(ret), K(pkey));
} else if (OB_FAIL(partition->set_valid())) {
STORAGE_LOG(WARN, "partition set valid failed", K(pkey), K(ret));
} else if (OB_FAIL(partition->get_pg_storage().restore_mem_trans_table())) {
LOG_WARN("failed to restore_mem_trans_table", K(pkey), K(ret));
} else {
partition->get_pg_storage().online();
STORAGE_LOG(INFO, "log new partition success", K(pkey));
}
}
return ret;
}
int ObPartitionService::add_partitions_to_mgr(common::ObIArray<ObIPartitionGroup*>& partitions)
int ObPartitionService::add_partitions_to_mgr(common::ObIArray<ObIPartitionGroup *> &partitions)
{
int ret = OB_SUCCESS;
int64_t added_pg_count = 0;
...
...
@@ -3308,6 +3270,8 @@ int ObPartitionService::online_partition(const ObPartitionKey& pkey, const int64
} else if (OB_ISNULL(pg = guard.get_partition_group())) {
ret = OB_ERR_UNEXPECTED;
STORAGE_LOG(WARN, "get partition failed", K(pkey), K(ret));
} else if (!pg->is_valid() && OB_FAIL(pg->set_valid())) {
STORAGE_LOG(WARN, "partition set valid failed", K(pkey), K(ret));
} else {
// set a mark for the partiion, and cancel the mark after clog is tracked within 500ms
(void)guard.get_partition_group()->set_migrating_flag(true);
...
...
src/storage/ob_partition_service.h
浏览文件 @
3ad80b7d
...
...
@@ -349,8 +349,6 @@ public:
const
common
::
ObIArray
<
obrpc
::
ObCreatePartitionArg
>&
batch_arg
,
common
::
ObIArray
<
int
>&
batch_res
);
VIRTUAL_FOR_UNITTEST
int
create_new_partition
(
const
common
::
ObPartitionKey
&
key
,
ObIPartitionGroup
*&
partition
);
VIRTUAL_FOR_UNITTEST
int
add_new_partition
(
ObIPartitionGroupGuard
&
partition_guard
);
VIRTUAL_FOR_UNITTEST
int
log_new_partition
(
ObIPartitionGroup
*
partition
,
const
int64_t
publish_version
,
const
int64_t
restore_snapshot_version
,
const
uint64_t
last_restore_log_id
,
const
int64_t
last_restore_log_ts
);
VIRTUAL_FOR_UNITTEST
int
remove_partition
(
const
common
::
ObPartitionKey
&
key
,
const
bool
write_slog
=
true
);
VIRTUAL_FOR_UNITTEST
int
remove_partition_from_pg
(
const
bool
for_replay
,
const
ObPartitionKey
&
pg_key
,
const
ObPartitionKey
&
pkey
,
const
uint64_t
log_id
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录