提交 d9494719 编写于 作者: O obdev 提交者: wangzelin.wzl

[CP] Fix some schema & ddl problems

上级 625713e6
......@@ -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))) {
......@@ -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", KR(ret));
}
LOG_INFO("[SCHEMA_RECYCLE] recycle schema history finish", K(ret));
LOG_INFO("[SCHEMA_RECYCLE] recycle schema history finish", KR(ret));
// retry until stopped, reset ret to OB_SUCCESS
ret = OB_SUCCESS;
idle();
......
......@@ -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", KR(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", KR(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 ", KR(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", KR(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", KR(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", KR(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.
先完成此消息的编辑!
想要评论请 注册