fix: tenant memory leak when create tenant failed
This commit is contained in:
@ -958,9 +958,8 @@ int ObMultiTenant::create_tenant(const ObTenantMeta &meta, bool write_slog, cons
|
|||||||
if (!is_virtual_tenant_id(tenant_id) && OB_TMP_FAIL(update_tenant_config(tenant_id))) {
|
if (!is_virtual_tenant_id(tenant_id) && OB_TMP_FAIL(update_tenant_config(tenant_id))) {
|
||||||
LOG_WARN("update tenant config fail", K(tenant_id), K(tmp_ret));
|
LOG_WARN("update tenant config fail", K(tenant_id), K(tmp_ret));
|
||||||
}
|
}
|
||||||
// no need rollback when replaying slog and creating a virtual tenant,
|
|
||||||
// in which two case the write_slog flag is set to false
|
if (OB_FAIL(ret)) {
|
||||||
if (OB_FAIL(ret) && write_slog) {
|
|
||||||
do {
|
do {
|
||||||
tmp_ret = OB_SUCCESS;
|
tmp_ret = OB_SUCCESS;
|
||||||
if (create_step >= ObTenantCreateStep::STEP_TENANT_NEWED) {
|
if (create_step >= ObTenantCreateStep::STEP_TENANT_NEWED) {
|
||||||
@ -973,7 +972,9 @@ int ObMultiTenant::create_tenant(const ObTenantMeta &meta, bool write_slog, cons
|
|||||||
ob_delete(tenant);
|
ob_delete(tenant);
|
||||||
tenant = nullptr;
|
tenant = nullptr;
|
||||||
}
|
}
|
||||||
if (OB_SUCCESS != (tmp_ret = clear_persistent_data(tenant_id))) {
|
// no need rollback when replaying slog and creating a virtual tenant,
|
||||||
|
// in which two case the write_slog flag is set to false
|
||||||
|
if (write_slog && OB_SUCCESS != (tmp_ret = clear_persistent_data(tenant_id))) {
|
||||||
LOG_ERROR("fail to clear persistent data", K(tenant_id), K(tmp_ret));
|
LOG_ERROR("fail to clear persistent data", K(tenant_id), K(tmp_ret));
|
||||||
SLEEP(1);
|
SLEEP(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user