Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
不争之德
oceanbase
提交
d9494719
O
oceanbase
项目概览
不争之德
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d9494719
编写于
9月 20, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
9月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] Fix some schema & ddl problems
上级
625713e6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
18 deletion
+25
-18
src/rootserver/ob_ddl_service.cpp
src/rootserver/ob_ddl_service.cpp
+1
-2
src/rootserver/ob_schema_history_recycler.cpp
src/rootserver/ob_schema_history_recycler.cpp
+5
-3
src/share/schema/ob_multi_version_schema_service.cpp
src/share/schema/ob_multi_version_schema_service.cpp
+19
-13
未找到文件。
src/rootserver/ob_ddl_service.cpp
浏览文件 @
d9494719
...
...
@@ -2259,8 +2259,7 @@ int ObDDLService::create_tables_in_trans(const bool if_not_exist, const ObString
false, // is index
old_view_schema))) {
LOG_WARN("failed to get table schema", K(view_name), K(ret));
}
if (OB_ISNULL(old_view_schema)) {
} else if (OB_ISNULL(old_view_schema)) {
ret = OB_SUCCESS;
} else {
if (OB_FAIL(ddl_operator.drop_table(*old_view_schema, trans))) {
src/rootserver/ob_schema_history_recycler.cpp
浏览文件 @
d9494719
...
...
@@ -184,15 +184,17 @@ void ObSchemaHistoryRecycler::run3()
int
ret
=
OB_SUCCESS
;
if
(
!
inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
));
LOG_WARN
(
"not inited"
,
KR
(
ret
));
}
else
if
(
OB_FAIL
(
recycle_schema_versions_
.
clear
()))
{
LOG_WARN
(
"fail to clear recycle schema version map"
,
KR
(
ret
));
}
else
{
while
(
!
stop_
)
{
ObCurTraceId
::
init
(
GCTX
.
self_addr_
);
LOG_INFO
(
"[SCHEMA_RECYCLE] recycle schema history start"
);
if
(
OB_FAIL
(
try_recycle_schema_history
()))
{
LOG_WARN
(
"fail to recycle schema history"
,
K
(
ret
));
LOG_WARN
(
"fail to recycle schema history"
,
K
R
(
ret
));
}
LOG_INFO
(
"[SCHEMA_RECYCLE] recycle schema history finish"
,
K
(
ret
));
LOG_INFO
(
"[SCHEMA_RECYCLE] recycle schema history finish"
,
K
R
(
ret
));
// retry until stopped, reset ret to OB_SUCCESS
ret
=
OB_SUCCESS
;
idle
();
...
...
src/share/schema/ob_multi_version_schema_service.cpp
浏览文件 @
d9494719
...
...
@@ -3975,14 +3975,14 @@ int ObMultiVersionSchemaService::try_gc_existed_tenant_schema_mgr()
ObArray
<
uint64_t
>
tenant_ids
;
if
(
!
check_inner_stat
())
{
ret
=
OB_INNER_STAT_ERROR
;
LOG_WARN
(
"inner stat error"
,
K
(
ret
));
LOG_WARN
(
"inner stat error"
,
K
R
(
ret
));
}
else
if
(
!
is_sys_full_schema
())
{
ret
=
OB_SCHEMA_EAGAIN
;
LOG_WARN
(
"full schema is not ready, cann't get fallback schema guard"
,
K
(
ret
));
LOG_WARN
(
"full schema is not ready, cann't get fallback schema guard"
,
K
R
(
ret
));
}
else
if
(
OB_FAIL
(
get_tenant_schema_guard
(
OB_SYS_TENANT_ID
,
schema_guard
)))
{
LOG_WARN
(
"get schema guard failed "
,
K
(
ret
));
LOG_WARN
(
"get schema guard failed "
,
K
R
(
ret
));
}
else
if
(
OB_FAIL
(
schema_guard
.
get_tenant_ids
(
tenant_ids
)))
{
LOG_WARN
(
"fail to get tenant ids"
,
K
(
ret
));
LOG_WARN
(
"fail to get tenant ids"
,
K
R
(
ret
));
}
else
{
bool
is_schema_splited
=
GCTX
.
is_schema_splited
();
ObSchemaMemMgr
*
mem_mgr
=
NULL
;
...
...
@@ -3992,7 +3992,7 @@ int ObMultiVersionSchemaService::try_gc_existed_tenant_schema_mgr()
mem_mgr
=
&
mem_mgr_
;
schema_mgr_cache
=
&
schema_mgr_cache_
;
if
(
OB_FAIL
(
try_gc_another_allocator
(
tenant_id
,
mem_mgr
,
schema_mgr_cache
)))
{
LOG_WARN
(
"fail to gc another allocator"
,
K
(
ret
));
LOG_WARN
(
"fail to gc another allocator"
,
K
R
(
ret
));
}
else
if
(
ObSchemaService
::
g_liboblog_mode_
)
{
// liboblog/agentserver do nothing
}
else
if
(
OB_FAIL
(
try_gc_tenant_schema_mgr_for_fallback
(
tenant_id
,
false
)))
{
...
...
@@ -4004,16 +4004,22 @@ int ObMultiVersionSchemaService::try_gc_existed_tenant_schema_mgr()
const
uint64_t
tenant_id
=
tenant_ids
.
at
(
i
);
if
(
NULL
==
(
schema_store
=
schema_store_map_
.
get
(
tenant_id
)))
{
ret
=
OB_ENTRY_NOT_EXIST
;
LOG_WARN
(
"fail to get schema_store"
,
K
(
ret
));
LOG_WARN
(
"fail to get schema_store"
,
K
R
(
ret
));
}
else
if
(
FALSE_IT
(
schema_mgr_cache
=
&
schema_store
->
schema_mgr_cache_
))
{
}
else
if
(
OB_FAIL
(
mem_mgr_map_
.
get_refactored
(
tenant_id
,
mem_mgr
)))
{
LOG_WARN
(
"fail to get mem mgr"
,
K
(
ret
),
K
(
tenant_id
));
}
else
if
(
OB_FAIL
(
try_gc_another_allocator
(
tenant_id
,
mem_mgr
,
schema_mgr_cache
)))
{
LOG_WARN
(
"fail to gc another allocator"
,
K
(
ret
),
K
(
tenant_id
));
}
else
if
(
ObSchemaService
::
g_liboblog_mode_
)
{
// liboblog/agentserver do nothing
}
else
if
(
OB_FAIL
(
try_gc_tenant_schema_mgr_for_fallback
(
tenant_id
)))
{
LOG_WARN
(
"fail to gc tenant schema mgr for fallback"
,
KR
(
ret
),
K
(
tenant_id
));
LOG_WARN
(
"fail to get mem mgr"
,
KR
(
ret
),
K
(
tenant_id
));
}
else
{
// ignore failure in eache scene
// 1. another allocator for schema refresh
if
(
OB_FAIL
(
try_gc_another_allocator
(
tenant_id
,
mem_mgr
,
schema_mgr_cache
)))
{
LOG_WARN
(
"fail to gc another allocator"
,
KR
(
ret
),
K
(
tenant_id
));
}
// 2. schema fallback
if
(
ObSchemaService
::
g_liboblog_mode_
)
{
// liboblog/agentserver do nothing
}
else
if
(
OB_FAIL
(
try_gc_tenant_schema_mgr_for_fallback
(
tenant_id
)))
{
LOG_WARN
(
"fail to gc tenant schema mgr for fallback"
,
KR
(
ret
),
K
(
tenant_id
));
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录