[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

@ -55,20 +55,6 @@ namespace common
{
using namespace oceanbase::obrpc;
void get_tenant_ids(uint64_t *ids, int cap, int &cnt)
{
auto *instance = ObMallocAllocator::get_instance();
cnt = 0;
for (uint64_t tenant_id = 1; tenant_id <= instance->get_max_used_tenant_id() && cnt < cap; ++tenant_id) {
if (nullptr != instance->get_tenant_ctx_allocator(tenant_id,
ObCtxIds::DEFAULT_CTX_ID) ||
nullptr != instance->get_tenant_ctx_allocator_unrecycled(tenant_id,
ObCtxIds::DEFAULT_CTX_ID)) {
ids[cnt++] = tenant_id;
}
}
}
ObVirtualTenantManager::ObVirtualTenantManager()
: tenant_map_(NULL),
tenant_pool_(),