From ac2a5a0f74cdc57ce7feafdc32f19d12a5e8bfb8 Mon Sep 17 00:00:00 2001 From: obdev Date: Fri, 24 Feb 2023 16:23:03 +0000 Subject: [PATCH] recycle tenant_allocator when tenant creation fails --- src/observer/omt/ob_multi_tenant.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/observer/omt/ob_multi_tenant.cpp b/src/observer/omt/ob_multi_tenant.cpp index e96f120637..5f6bfd821c 100644 --- a/src/observer/omt/ob_multi_tenant.cpp +++ b/src/observer/omt/ob_multi_tenant.cpp @@ -964,6 +964,9 @@ int ObMultiTenant::create_tenant(const ObTenantMeta &meta, bool write_slog, cons bucket_lock_.unlock(bucket_lock_idx); } + if (OB_FAIL(ret)) { + malloc_allocator->recycle_tenant_allocator(tenant_id); + } FLOG_INFO("finish create new tenant", K(ret), K(tenant_id), K(write_slog), K(create_step), K(bucket_lock_idx)); return ret; @@ -2234,4 +2237,4 @@ int ObSrvNetworkFrame::reload_sql_thread_config() } } return ret; -} \ No newline at end of file +}