[ 
https://issues.apache.org/jira/browse/HDDS-16876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chi-Hsuan Huang resolved HDDS-16876.
------------------------------------
    Fix Version/s: 2.3.0
       Resolution: Fixed

> 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
>             Fix For: 2.3.0
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to