You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/10/22 08:36:00 UTC
[jira] [Updated] (HDDS-16876) NumTenants is not initialized from tenantStateTable on OM startup
[ https://issues.apache.org/jira/browse/HDDS-16876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated HDDS-16876:
----------------------------------
Labels: pull-request-available (was: )
> NumTenants is not initialized from tenantStateTable on OM startup
> -----------------------------------------------------------------
>
> Key: HDDS-16876
> URL: https://issues.apache.org/jira/browse/HDDS-16876
> Project: Apache Ozone
> Issue Type: Bug
> Components: Ozone Manager
> Reporter: Chi-Hsuan Huang
> Assignee: Chi-Hsuan Huang
> Priority: Major
> Labels: pull-request-available
>
> Follow-up to HDDS-16719.
> {{OMMetrics.numTenants}} is only updated by events: {{OMTenantCreateRequest}} calls {{incNumTenants()}} and {{OMTenantDeleteRequest}} calls {{decNumTenants()}}. Nothing initializes it from {{tenantStateTable}} when OM starts:
> * {{OzoneManager.start()}} and {{restart()}} set volume, bucket, key, dir and file counts from the DB, and {{updateActiveSnapshotMetrics()}} recounts snapshots, but tenants are not counted.
> * {{OMMultiTenantManagerImpl.loadTenantCacheFromDB()}} already iterates {{tenantStateTable}} on startup to build the tenant cache, but does not update the metric.
> As a result, {{NumTenants}} starts at 0 after every OM restart, and deleting a tenant created before the restart can make it negative. This only affects clusters with {{ozone.om.multitenancy.enabled=true}}.
> Proposed changes:
> * Add {{setNumTenants()}} and set it from the tenant count when the tenant cache is loaded from DB.
> * Add a test that creates tenants, restarts OM, and checks {{NumTenants}}.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org