Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
3ff5fb98
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,发现更多精彩内容 >>
提交
3ff5fb98
编写于
6月 21, 2022
作者:
W
wanhong.wwh
提交者:
wangzelin.wzl
6月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] Fix global index issues: after drop/truncate partition, global index can not rereplicate
上级
3156d1bf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
3 deletion
+20
-3
src/rootserver/ob_balance_info.h
src/rootserver/ob_balance_info.h
+1
-3
src/share/schema/ob_schema_struct.cpp
src/share/schema/ob_schema_struct.cpp
+6
-0
src/share/schema/ob_schema_struct.h
src/share/schema/ob_schema_struct.h
+6
-0
src/share/schema/ob_table_schema.h
src/share/schema/ob_table_schema.h
+7
-0
未找到文件。
src/rootserver/ob_balance_info.h
浏览文件 @
3ff5fb98
...
@@ -1229,9 +1229,7 @@ int TenantBalanceStat::fill_partition_entity(const uint64_t schema_id, const SCH
...
@@ -1229,9 +1229,7 @@ int TenantBalanceStat::fill_partition_entity(const uint64_t schema_id, const SCH
}
else
if
(
OB_FAIL
(
build_readonly_at_all_info
(
schema_id
,
schema
)))
{
}
else
if
(
OB_FAIL
(
build_readonly_at_all_info
(
schema_id
,
schema
)))
{
RS_LOG
(
WARN
,
"fail to build readonly at all info"
,
K
(
ret
),
K
(
schema_id
));
RS_LOG
(
WARN
,
"fail to build readonly at all info"
,
K
(
ret
),
K
(
schema_id
));
}
else
{
}
else
{
bool
can_do_rereplicate
=
bool
can_do_rereplicate
=
!
schema
.
is_global_index_table
()
||
schema
.
can_rereplicate_global_index_table
();
!
schema
.
is_global_index_table
()
||
(
schema
.
is_global_index_table
()
&&
schema
.
can_read_index
())
||
(
schema
.
is_global_index_table
()
&&
schema
.
is_mock_global_index_invalid
()
&&
!
schema
.
can_read_index
());
share
::
ObPartitionInfo
info
;
share
::
ObPartitionInfo
info
;
int64_t
partition_idx
=
OB_INVALID_INDEX
;
int64_t
partition_idx
=
OB_INVALID_INDEX
;
bool
check_dropped_partition
=
true
;
bool
check_dropped_partition
=
true
;
...
...
src/share/schema/ob_schema_struct.cpp
浏览文件 @
3ff5fb98
...
@@ -7743,6 +7743,12 @@ const char* ob_view_check_option_str(const ViewCheckOption option)
...
@@ -7743,6 +7743,12 @@ const char* ob_view_check_option_str(const ViewCheckOption option)
return
ret
;
return
ret
;
}
}
bool
can_rereplicate_index_status
(
const
ObIndexStatus
&
idst
)
{
// unusable index can also rereplicate
return
INDEX_STATUS_AVAILABLE
==
idst
||
INDEX_STATUS_UNUSABLE
==
idst
;
}
const
char
*
ob_index_status_str
(
ObIndexStatus
status
)
const
char
*
ob_index_status_str
(
ObIndexStatus
status
)
{
{
const
char
*
ret
=
"invalid"
;
const
char
*
ret
=
"invalid"
;
...
...
src/share/schema/ob_schema_struct.h
浏览文件 @
3ff5fb98
...
@@ -247,6 +247,8 @@ enum ObIndexStatus {
...
@@ -247,6 +247,8 @@ enum ObIndexStatus {
INDEX_STATUS_MAX
=
8
,
INDEX_STATUS_MAX
=
8
,
};
};
bool
can_rereplicate_index_status
(
const
ObIndexStatus
&
idst
);
enum
ObPartitionStatus
{
enum
ObPartitionStatus
{
PARTITION_STATUS_INVALID
=
-
1
,
PARTITION_STATUS_INVALID
=
-
1
,
PARTITION_STATUS_ACTIVE
=
0
,
PARTITION_STATUS_ACTIVE
=
0
,
...
@@ -3267,6 +3269,10 @@ public:
...
@@ -3267,6 +3269,10 @@ public:
{
{
return
true
;
return
true
;
}
}
inline
bool
can_rereplicate_global_index_table
()
const
{
return
true
;
}
DECLARE_VIRTUAL_TO_STRING
;
DECLARE_VIRTUAL_TO_STRING
;
...
...
src/share/schema/ob_table_schema.h
浏览文件 @
3ff5fb98
...
@@ -639,6 +639,13 @@ public:
...
@@ -639,6 +639,13 @@ public:
{
{
return
INDEX_STATUS_AVAILABLE
==
index_status
&&
!
is_dropped_schema
;
return
INDEX_STATUS_AVAILABLE
==
index_status
&&
!
is_dropped_schema
;
}
}
inline
bool
can_rereplicate_global_index_table
()
const
{
// 1. index which can rereplicate
// 2. is mocked invalid for standby cluster
return
is_global_index_table
()
&&
!
is_dropped_schema
()
&&
(
can_rereplicate_index_status
(
index_status_
)
||
is_mock_global_index_invalid
());
}
inline
bool
is_final_invalid_index
()
const
;
inline
bool
is_final_invalid_index
()
const
;
inline
void
set_index_status
(
const
ObIndexStatus
index_status
)
inline
void
set_index_status
(
const
ObIndexStatus
index_status
)
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录