[FEAT MERGE] Add anti-fallback checks for the memory of 500 tenant

This commit is contained in:
obdev
2023-04-25 02:41:25 +00:00
committed by ob-robot
parent c317071f7e
commit fdcaa9a932
135 changed files with 936 additions and 660 deletions

View File

@ -79,6 +79,7 @@ const char *ObMultiVersionSchemaService::print_refresh_schema_mode(const Refresh
ObSchemaConstructTask::ObSchemaConstructTask()
{
schema_tasks_.set_attr(SET_USE_500(ObMemAttr(OB_SERVER_TENANT_ID, "SchemaTasks")));
(void)pthread_mutex_init(&schema_mutex_, NULL);
(void)pthread_cond_init(&schema_cond_, NULL);
}
@ -3679,8 +3680,8 @@ int ObMultiVersionSchemaService::get_new_schema_version(uint64_t tenant_id, int6
}
int ObMultiVersionSchemaService::get_tenant_mem_info(
const uint64_t &tenant_id,
common::ObIArray<ObSchemaMemory> &tenant_mem_infos)
const uint64_t &tenant_id,
common::ObIArray<ObSchemaMemory> &tenant_mem_infos)
{
int ret = OB_SUCCESS;
ObSchemaMemMgr *mem_mgr = NULL;
@ -3697,19 +3698,19 @@ int ObMultiVersionSchemaService::get_tenant_mem_info(
ret = OB_ERR_UNEXPECTED;
LOG_WARN("mem_mgr is NULL", KR(ret), K(tenant_id));
} else if (OB_FAIL(mem_mgr->get_all_alloc_info(tenant_mem_infos))) {
LOG_WARN("fail to get mem_mgr alloc info", KR(ret), K(tenant_id));
LOG_WARN("fail to get mem_mgr alloc info", KR(ret), K(tenant_id));
}
return ret;
}
int ObMultiVersionSchemaService::get_tenant_slot_info(
common::ObIAllocator &allocator,
const uint64_t &tenant_id,
common::ObIAllocator &allocator,
const uint64_t &tenant_id,
common::ObIArray<ObSchemaSlot> &tenant_slot_infos)
{
int ret = OB_SUCCESS;
ObSchemaStore * schema_store = NULL;
if (OB_INVALID_TENANT_ID == tenant_id) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid tenant_id", KR(ret), K(tenant_id));
@ -3735,7 +3736,7 @@ int ObMultiVersionSchemaService::get_schema_store_tenants(common::ObIArray<uint6
bool ObMultiVersionSchemaService::check_schema_store_tenant_exist(const uint64_t &tenant_id) {
bool exist = true;
ObSchemaStore* schema_store = NULL;
ObSchemaStore* schema_store = NULL;
if (OB_ISNULL(schema_store = schema_store_map_.get(tenant_id))) {
exist = false;
}