Skip to content

HDDS-13465. Adding endpoint at Recon to get consolidated storage distribution report#8995

Merged
ArafatKhan2198 merged 19 commits intoapache:HDDS-13177from
priyeshkaratha:HDDS-13465_Metrics_Aproach
Sep 30, 2025
Merged

HDDS-13465. Adding endpoint at Recon to get consolidated storage distribution report#8995
ArafatKhan2198 merged 19 commits intoapache:HDDS-13177from
priyeshkaratha:HDDS-13465_Metrics_Aproach

Conversation

@priyeshkaratha
Copy link
Copy Markdown
Contributor

@priyeshkaratha priyeshkaratha commented Sep 2, 2025

What changes were proposed in this pull request?

A new REST API endpoint /storagedistribution has been introduced to provide a summarized view of storage distribution across the cluster. This endpoint is designed to consolidate various storage-related insights, particularly focusing on used capacity, pending deletions, and overall data distribution across Ozone components.

Key Functionalities

  1. Endpoint Name: /storagedistribution
    • Exposes consolidated metrics related to the usage and distribution of storage.
  2. Data Sources Used:
    • OMDBInsightEndpoint:

      • Retrieves OM-level data such as bucket-level usage, namespace size, and used capacity
    • SCMClient:

      • Fetches pending deletion metrics from SCM.
      • This includes block-level metadata such as size and replicated size info for accurate estimation of reclaimable space.
    • Datanode Storage Reports:

      • Gathers current storage usage statistics from individual datanodes.
      • Helps in determining used vs available capacity and contributes to classifying data distribution based on node-wise storage usage.

      Here the pending deletion bytes are calculated and updated in the BlockDeletionService metrics, which are then exposed via JMX. This allows for direct access to these metrics by monitoring tools. The primary disadvantage of this approach is the introduction of a dependency on JMX. While this might be a minor concern in some deployments, it's worth noting the additional dependency. This method avoids the unnecessary data transfer to SCM and the associated processing overhead in DN while iterating and calculating pending deletion from the container data list that is present with the Storage Report approach.

What is the link to the Apache JIRA

HDDS-13465

How was this patch tested?

Currently tested by unit test cases by mocking SCM and DN data. Also tested manually using postman.

@priyeshkaratha priyeshkaratha force-pushed the HDDS-13465_Metrics_Aproach branch from 6e1c590 to bb69fa6 Compare September 2, 2025 08:01
@priyeshkaratha priyeshkaratha changed the title HDDS-13465 Calculation of Pending Deleting bytes using BlockDeleting metrics HDDS-13465. Adding endpoint at Recon to get consolidated storage distribution report Sep 2, 2025
@priyeshkaratha
Copy link
Copy Markdown
Contributor Author

@ArafatKhan2198 @devmadhuu @sumitagrawl @ChenSammi Please review the code changes.

Copy link
Copy Markdown
Contributor

@devmadhuu devmadhuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @priyeshkaratha for the patch. Few comments

try {
conn.disconnect();
} catch (Exception ignored) {
// no-op
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How this is being handled at UI ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In UI, it will always get value of 0 or the actual values. So errors will be logged at server side.

// ignore read errors on error stream
}
log.warn("HTTP {} from {}. Error body: {}", code, conn.getURL(), err);
return "";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty response is valid response. How UI is going to handle in case of IOException which is ignored after being caught ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parseMetrics method will handle empty string and it will return 0L as metrics.

@errose28
Copy link
Copy Markdown
Contributor

errose28 commented Sep 8, 2025

There is still an open design doc in this area in #8907. We should reach consensus on that before merging changes like this.

Copy link
Copy Markdown
Contributor

@devmadhuu devmadhuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few more comments.

Comment thread hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java Outdated
Copy link
Copy Markdown
Contributor

@ArafatKhan2198 ArafatKhan2198 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work @priyeshkaratha
Some comments and questions.

Comment thread hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java Outdated
@priyeshkaratha priyeshkaratha force-pushed the HDDS-13465_Metrics_Aproach branch 2 times, most recently from cebf13d to 5e818fa Compare September 16, 2025 09:58
@priyeshkaratha priyeshkaratha force-pushed the HDDS-13465_Metrics_Aproach branch from bee8c10 to 0e367cf Compare September 17, 2025 02:36
@priyeshkaratha
Copy link
Copy Markdown
Contributor Author

@ArafatKhan2198 @devmadhuu Thanks for the reviews. Handled all the review comments and rebased with latest feature branch.

@priyeshkaratha priyeshkaratha force-pushed the HDDS-13465_Metrics_Aproach branch from adf05bb to e6c934e Compare September 17, 2025 04:06
@priyeshkaratha priyeshkaratha marked this pull request as ready for review September 17, 2025 07:23
Copy link
Copy Markdown
Contributor

@devmadhuu devmadhuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @priyeshkaratha , changes largely looks fine to me. However you need to still address and close design points raised by @errose28 before merging.

@priyeshkaratha
Copy link
Copy Markdown
Contributor Author

priyeshkaratha commented Sep 18, 2025

@errose28 I have addressed your comments in #8907

Copy link
Copy Markdown
Contributor

@ArafatKhan2198 ArafatKhan2198 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !
Thanks for working on this.

@ArafatKhan2198 ArafatKhan2198 merged commit e91543b into apache:HDDS-13177 Sep 30, 2025
41 of 42 checks passed
priyeshkaratha added a commit to priyeshkaratha/ozone that referenced this pull request Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants