Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
0b54fb4b
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,发现更多精彩内容 >>
提交
0b54fb4b
编写于
7月 22, 2021
作者:
O
obdev
提交者:
wangzelin.wzl
7月 22, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix check_sync_state schema version for switchover
上级
2cd51447
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
46 addition
and
31 deletion
+46
-31
src/storage/ob_partition_service.cpp
src/storage/ob_partition_service.cpp
+46
-31
未找到文件。
src/storage/ob_partition_service.cpp
浏览文件 @
0b54fb4b
...
@@ -11672,10 +11672,24 @@ int ObPartitionService::check_all_partition_sync_state(const int64_t switchover_
...
@@ -11672,10 +11672,24 @@ int ObPartitionService::check_all_partition_sync_state(const int64_t switchover_
ret = OB_ERR_UNEXPECTED;
ret = OB_ERR_UNEXPECTED;
STORAGE_LOG(WARN, "get_log_service return NULL");
STORAGE_LOG(WARN, "get_log_service return NULL");
} else {
} else {
int64_t local_schema_version = OB_INVALID_VERSION;
int64_t pg_create_schema_version = OB_INVALID_VERSION;
const common::ObPartitionKey pkey = partition->get_partition_key();
const common::ObPartitionKey pkey = partition->get_partition_key();
const uint64_t tenant_id_for_get_schema = is_inner_table(pkey.get_table_id()) ? OB_SYS_TENANT_ID : pkey.get_tenant_id();
int tmp_ret = OB_SUCCESS;
int tmp_ret = OB_SUCCESS;
bool is_sync = false;
bool is_sync = false;
if (!ObMultiClusterUtil::is_cluster_private_table(pkey.get_table_id())) {
if (OB_FAIL(partition->get_pg_storage().get_create_schema_version(pg_create_schema_version))) {
if (REACH_TIME_INTERVAL(1000 * 1000)) {
STORAGE_LOG(WARN, "fail to get create schema version for pg", K(ret), K(pkey));
}
} else if (OB_FAIL(schema_guard.get_schema_version(tenant_id_for_get_schema, local_schema_version))) {
STORAGE_LOG(WARN, "fail to get schema version", K(ret), K(pkey), K(tenant_id_for_get_schema));
} else if (pg_create_schema_version > local_schema_version
|| !share::schema::ObSchemaService::is_formal_version(local_schema_version)) {
STORAGE_LOG(INFO, "new partition group, schema is not flushed", K(pkey),
K(local_schema_version), K(pg_create_schema_version));
} else if (! ObMultiClusterUtil::is_cluster_private_table(pkey.get_table_id())) {
// The replica to be synchronized across clusters must also check switchover_epoch
// The replica to be synchronized across clusters must also check switchover_epoch
if (OB_SUCCESS != (tmp_ret = pls->is_log_sync_with_primary(switchover_epoch, is_sync))) {
if (OB_SUCCESS != (tmp_ret = pls->is_log_sync_with_primary(switchover_epoch, is_sync))) {
STORAGE_LOG(WARN, "is_log_sync_with_primary failed", K(tmp_ret), K(pkey));
STORAGE_LOG(WARN, "is_log_sync_with_primary failed", K(tmp_ret), K(pkey));
...
@@ -11684,8 +11698,10 @@ int ObPartitionService::check_all_partition_sync_state(const int64_t switchover_
...
@@ -11684,8 +11698,10 @@ int ObPartitionService::check_all_partition_sync_state(const int64_t switchover_
// The replica that does not need to be synchronized across clusters
// The replica that does not need to be synchronized across clusters
is_sync = true;
is_sync = true;
}
}
if (OB_SUCC(ret)) {
if (!is_sync) {
if (!is_sync) {
STORAGE_LOG(INFO, "this partition is not sync with leader, need check schema", K(pkey
));
STORAGE_LOG(INFO, "this partition is not sync with leader, need check schema", K(pkey), K(ret
));
}
}
bool is_dropped = false;
bool is_dropped = false;
...
@@ -11697,15 +11713,13 @@ int ObPartitionService::check_all_partition_sync_state(const int64_t switchover_
...
@@ -11697,15 +11713,13 @@ int ObPartitionService::check_all_partition_sync_state(const int64_t switchover_
STORAGE_LOG(WARN, "get all pg partition keys error", K(tmp_ret), K(pkey));
STORAGE_LOG(WARN, "get all pg partition keys error", K(tmp_ret), K(pkey));
} else if (!partition->is_pg()) {
} else if (!partition->is_pg()) {
// dealing with stand alone partition
// dealing with stand alone partition
if (OB_SUCCESS !=
if (OB_SUCCESS != (tmp_ret = schema_guard.check_partition_can_remove(
(tmp_ret = schema_guard.check_partition_can_remove(
pkey.get_table_id(), pkey.get_partition_id(), check_dropped_partition, is_dropped))) {
pkey.get_table_id(), pkey.get_partition_id(), check_dropped_partition, is_dropped))) {
STORAGE_LOG(WARN, "fail to check partition exist", K(tmp_ret), K(pkey));
STORAGE_LOG(WARN, "fail to check partition exist", K(tmp_ret), K(pkey));
}
}
} else {
} else {
// The deletion of PG will only be judged after all the partitions in PG are completed by gc
// The deletion of PG will only be judged after all the partitions in PG are completed by gc
if (OB_SUCCESS !=
if (OB_SUCCESS != (tmp_ret = schema_guard.check_partition_can_remove(
(tmp_ret = schema_guard.check_partition_can_remove(
pkey.get_tablegroup_id(), pkey.get_partition_group_id(), check_dropped_partition, is_dropped))) {
pkey.get_tablegroup_id(), pkey.get_partition_group_id(), check_dropped_partition, is_dropped))) {
STORAGE_LOG(WARN, "fail to check partition group exist", K(tmp_ret), K(pkey));
STORAGE_LOG(WARN, "fail to check partition group exist", K(tmp_ret), K(pkey));
}
}
...
@@ -11720,6 +11734,7 @@ int ObPartitionService::check_all_partition_sync_state(const int64_t switchover_
...
@@ -11720,6 +11734,7 @@ int ObPartitionService::check_all_partition_sync_state(const int64_t switchover_
}
}
}
}
}
}
}
if (OB_FAIL(ret) && OB_ITER_END != ret) {
if (OB_FAIL(ret) && OB_ITER_END != ret) {
fail_count++;
fail_count++;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录