[
https://issues.apache.org/jira/browse/HDDS-17006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andy Huang reassigned HDDS-17006:
---------------------------------
Assignee: Andy Huang
> [Recon][UI] Namespace Usage metadata shows 0 Bytes quota while Recon is
> initializing
> ------------------------------------------------------------------------------------
>
> Key: HDDS-17006
> URL: https://issues.apache.org/jira/browse/HDDS-17006
> Project: Apache Ozone
> Issue Type: Bug
> Components: Ozone Recon
> Reporter: Chi-Hsuan Huang
> Assignee: Andy Huang
> Priority: Minor
>
> h2. Problem
> While Recon is still building the namespace summary,
> {{/api/v1/namespace/quota}} returns {{{}{"status": "INITIALIZING", "allowed":
> 0, "used": 0}{}}}. The metadata panel on the Namespace Usage page does not
> detect this. It shows *Quota Allowed: 0 Bytes* and {*}Quota Used: 0 Bytes{*},
> and the "quota is currently initializing" message is never shown.
> h2. Cause
> {{nuMetadata.tsx}} checks {{{}quotaResponse.state === 'INITIALIZING'{}}}, but
> the response field is {{status}} ({{{}QuotaUsageResponse{}}} uses
> {{{}@JsonProperty("status"){}}}). The other quota checks in the same function
> already use {{{}status{}}}.
> [https://github.com/apache/ozone/blob/cce1ca28944886218132f01c0e271c1fd0700078/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/nuMetadata/nuMetadata.tsx#L347]
> The typo came in with HDDS-12016, which merged the summary and quota fetches.
> TypeScript did not catch it because the quota response is typed as {{any}}
> ({{{}useApiData<any>{}}}).
> h2. Proposed fix
> * Check {{quotaResponse.status}} instead of {{{}quotaResponse.state{}}}.
> * Add a type for the quota response ({{{}status{}}}, {{{}allowed{}}},
> {{{}used{}}}) instead of {{{}any{}}}.
> * Add a test where summary and quota both return {{{}INITIALIZING{}}}, and
> assert that the quota rows are not shown.
> Found while reviewing HDDS-9795
> ([apache/ozone#11513|https://github.com/apache/ozone/pull/11513]).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]