fix major freeze about tenants with !normal status

This commit is contained in:
LiefB
2023-06-15 03:24:06 +00:00
committed by ob-robot
parent 07b4afa6c3
commit e825de1713

View File

@ -148,9 +148,22 @@ int ObMajorFreezeHelper::get_all_tenant_freeze_info(
LOG_WARN("fail to get tenant ids", KR(ret));
} else {
for (int64_t i = 0; (i < tenant_ids.count()) && OB_SUCC(ret); ++i) {
obrpc::ObSimpleFreezeInfo info(tenant_ids[i]);
if(OB_FAIL(freeze_info_array.push_back(info))) {
LOG_WARN("fail to push back", KR(ret), "tenant_id", tenant_ids[i]);
// only launch major freeze for tenant whose status is normal, and skip major freeze for
// tenant whose status is not normal.
const ObSimpleTenantSchema *tenant_schema = nullptr;
if (OB_FAIL(schema_guard.get_tenant_info(tenant_ids[i], tenant_schema))) {
LOG_WARN("fail to get simple tenant schema", KR(ret), "tenant_id", tenant_ids[i]);
} else if (OB_ISNULL(tenant_schema)) {
ret = OB_INNER_STAT_ERROR;
LOG_WARN("tenant schema is null", KR(ret), "tenant_id", tenant_ids[i]);
} else if (OB_UNLIKELY(!tenant_schema->is_normal())) {
LOG_WARN("tenant status is not normal, skip major freeze for this tenant", "tenant_id",
tenant_ids[i], "status", tenant_schema->get_status());
} else { // tenant_schema->is_normal()
obrpc::ObSimpleFreezeInfo info(tenant_ids[i]);
if(OB_FAIL(freeze_info_array.push_back(info))) {
LOG_WARN("fail to push back", KR(ret), "tenant_id", tenant_ids[i]);
}
}
}
}