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

   ## What changes were proposed in this pull request?
   
   `ozone repair om compact` without `--node-id` printed `om node: null`, 
because the messages used the raw `--node-id` CLI argument, which is null when 
the option is omitted. In that same path, if the OM address could not be 
resolved, the tool passed a null `OMNodeDetails` on and hit an NPE.
   
   This change prints the node id when the operator supplies one, otherwise the 
resolved RPC address (`host:port`), so the output always identifies a real OM. 
It also adds a null-guard that reports a clear error instead of NPE-ing, 
matching the sibling `DefragSubCommand`.
   
   While testing on an HA cluster I found a separate pre-existing issue: 
without `--node-id`, the base `ozone.om.address` defaults to `0.0.0.0`, so the 
tool builds a non-null but useless `OMNodeDetails` and hangs retrying the RPC 
(the null-guard here does not apply). That is tracked separately in HDDS-15765 
and left out of this change.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-15733
   
   ## How was this patch tested?
   
   - New `TestCompactOMDB` (no `--node-id` shows the resolved address, not 
`null`; `--node-id` shows the given id; unresolved OM reports a clean error 
instead of an NPE):
     `mvn -pl :ozone-cli-repair -am test -Dtest=TestCompactOMDB`
   - Ran the tool on a local single-OM compose cluster and confirmed the 
output; `om node` now reads `om:9862` instead of `null`:
     `docker compose exec om ozone repair om compact --column-family fileTable`
   - Local checks pass:
     `hadoop-ozone/dev-support/checks/{checkstyle,rat,author}.sh`
   


-- 
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