chihsuan opened a new pull request, #10820:
URL: https://github.com/apache/ozone/pull/10820

   ## What changes were proposed in this pull request?
   
   SCM and datanodes balance open containers across a datanode's disks to 
maximize throughput, but there is currently no way to see whether OPEN 
containers are actually well distributed between the available disks. Recon's 
datanode view only shows aggregate storage numbers per node.
   
   This PR adds a per-disk breakdown of OPEN containers to the Recon datanode 
page:
   
   * **Wire format**: adds an additive `optional uint64 openContainerCount = 13 
[default = 0]` field to the per-disk `StorageReportProto` in the datanode 
heartbeat.
   * **Datanode**: `ContainerSet#getOpenContainerCountsByVolume()` counts OPEN 
containers per volume (keyed by storage ID), and 
`OzoneContainer#getNodeReport()` attaches the count to each disk's storage 
report. The count is computed once per node report interval (default 60s) with 
a single pass over the container map, so there is no per-write bookkeeping.
   * **Recon backend**: `NodeEndpoint` exposes a new `disks` list on each entry 
of the `/api/v1/datanodes` response, carrying per-disk location, 
capacity/used/remaining/committed, and the open container count.
   * **Recon UI**: datanode table rows become expandable; the expanded row 
shows a per-disk sub-table (Disk Location, Open Containers, Capacity bar).
   
   Design discussion (see Jira comment): the alternative was adding the volume 
to `ContainerReplicaProto` and joining per-replica data at SCM/Recon. The 
chosen approach keeps the change minimal because nothing currently needs the 
per-replica disk mapping: one optional field, no `ContainerReplicaProto` or SCM 
ingestion changes.
   
   Compatibility: the field is optional in a proto2 message. An old datanode 
simply does not set it; Recon detects the absent field and the UI renders `N/A` 
for that disk, so 0 (reported) and unknown (not reported) are distinguishable. 
An old SCM/Recon ignores the field. No `HDDSLayoutFeature` gating is needed.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-14560
   
   ## How was this patch tested?
   
   * New unit test `TestContainerSet#testGetOpenContainerCountsByVolume` (OPEN 
vs CLOSED, multiple volumes).
   * Extended `TestEndpoints` to assert the per-disk list in the datanode 
response, including the reported count and the null (not reported) case.
   * New frontend test in `DatanodesTable.test.tsx` covering the expanded 
per-disk row and the `N/A` rendering.
   * Manual verification on a local compose cluster (3 datanodes, 
`OZONE_REPLICATION_FACTOR=3`): wrote keys with freon, confirmed 
`/api/v1/datanodes` returns `disks` with correct `openContainerCount` per disk, 
and the UI shows the breakdown.
   
   (UI screenshot to be added)
   
   * CI on fork: https://github.com/chihsuan/ozone/actions/runs/29745582494
   
   Generated-by: Claude Code (claude-fable-5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to