You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2025/08/08 17:26:54 UTC

[PR] HDDS-13406. Standardize option for OM address for `ozone admin om` [ozone]

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

   ## What changes were proposed in this pull request?
   
   1. Create reusable classes for adding `--service-id` and `--service-host` options for OM.
   2. Apply the new mixins to `ozone admin om` commands
   3. Let `ozone admin om` accept `--om-service-id`, too, just like other commands.
   4. Deprecate `-id` and `-host` by hiding them, but continue accepting them.
   5. Downgrade picocli to 4.7.5 due to a bug that breaks `ArgGroup` usage.
   6. Close OM clients where it was missing
   
   https://issues.apache.org/jira/browse/HDDS-13406
   
   ## How was this patch tested?
   
   Existing tests:
   https://github.com/adoroszlai/ozone/actions/runs/16834543305
   
   Checked presence of `--om-service-id` and absence of `-id` in help of each command.  Some examples:
   
   ```bash
   $ ozone admin om prepare --help
   Usage: ozone admin om prepare [-hV] [--verbose] (--service-id=<serviceID>)
   Prepares Ozone Manager for upgrade/downgrade, by applying all pending
   transactions, taking a Ratis snapshot at the last transaction and purging all
   logs on each OM instance. The returned transaction #ID corresponds to the last
   transaction in the quorum in which the snapshot is taken.
     -h, --help      Show this help message and exit.
         --service-id, --om-service-id=<serviceID>
                     Ozone Manager Service ID.
     -V, --version   Print version information and exit.
         --verbose   More verbose output. Show the stack trace of the errors.
   
   
   $ ozone admin om decommission --help
   Usage: ozone admin om decommission --service-id=<om-service-id>
   -nodeid=<decommission-om-node-id> -hostname=<decommission-om-node-address>
   [options]
   Decommission an OzoneManager. Ensure that the node being decommissioned is
   shutdown first.
   Note - Add the node to be decommissioned to ozone.om.decommissioned.nodesconfig
   in ozone-site.xml of all OzoneManagers before proceeding with decommission.
   Note - DECOMMISSIONING AN OM MIGHT RENDER THE CLUSTER TO LOSE HIGH AVAILABILITY.
   Note - When there are only two OzoneManagers, do not stop the OzoneManager
   before decommissioning as both OzoneManagers are required to reach quorum.
   It is recommended to add another OzoneManager(s) before decommissioning one to
   maintain HA.
         --force     This option will skip checking whether OM configs have been
                       updated with the decommissioned node added to ozone.om.
                       decommissioned.nodes config in ozone-site.xml.
     -h, --help      Show this help message and exit.
         -hostname, --node-host-address=<hostname>
                     Host name/address of the OM to be decommissioned.
         -nodeid, --nodeid=<decommNodeId>
                     NodeID of the OM to be decommissioned.
         --service-id, --om-service-id=<serviceID>
                     Ozone Manager Service ID.
     -V, --version   Print version information and exit.
         --verbose   More verbose output. Show the stack trace of the errors.
   ```
   
   Also presence of both `--service-id` and `--service-host`:
   
   ```
   $ ozone admin om updateranger --help
   Usage: ozone admin om updateranger [-hV] [--no-wait] [--verbose]
                                      [--service-id=<serviceID> |
                                      --service-host=<host>]
   Trigger Ranger sync background service task on a leader OM that pushes policies
   and roles updates to Ranger. This operation requires Ozone administrator
   privilege.
     -h, --help      Show this help message and exit.
         --no-wait   Do not wait for task completion. Exit immediately after the
                       Ranger BG sync task is triggered on the OM.
         --service-host=<host>
                     Ozone Manager Host.
         --service-id, --om-service-id=<serviceID>
                     Ozone Manager Service ID.
     -V, --version   Print version information and exit.
         --verbose   More verbose output. Show the stack trace of the errors.
   ```


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-13406. Standardize option for OM address for `ozone admin om` [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #8918:
URL: https://github.com/apache/ozone/pull/8918


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-13406. Standardize option for OM address for `ozone admin om` [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #8918:
URL: https://github.com/apache/ozone/pull/8918#issuecomment-3188063584

   > Do we still need a `--service-host` flag? As of 2.0 non-Ratis OM is no longer supported so even a non-HA deployment is a 1 node ratis group and should have a service ID.
   
   Non-HA deployment uses Ratis, but service ID is not mandatory.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-13406. Standardize option for OM address for `ozone admin om` [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #8918:
URL: https://github.com/apache/ozone/pull/8918#issuecomment-3540717506

   Thanks @errose28 for the review.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-13406. Standardize option for OM address for `ozone admin om` [ozone]

Posted by "errose28 (via GitHub)" <gi...@apache.org>.
errose28 commented on PR #8918:
URL: https://github.com/apache/ozone/pull/8918#issuecomment-3185891500

   Do we still need a `--service-host` flag? As of 2.0 non-Ratis OM is no longer supported so even a non-HA deployment is a 1 node ratis group and should have a service ID.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-13406. Standardize option for OM address for `ozone admin om` [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #8918:
URL: https://github.com/apache/ozone/pull/8918#discussion_r2533300469


##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/ozone/admin/om/OMAdmin.java:
##########
@@ -98,19 +100,28 @@ public OzoneManagerProtocolClientSideTranslatorPB createOmClient(
       String omHost,
       boolean forceHA
   ) throws Exception {
-    OzoneConfiguration conf = parent.getOzoneConf();
+    return createOmClient(parent.getOzoneConf(), parent.getUser(), omServiceID, omHost, forceHA);

Review Comment:
   Removed.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-13406. Standardize option for OM address for `ozone admin om` [ozone]

Posted by "errose28 (via GitHub)" <gi...@apache.org>.
errose28 commented on code in PR #8918:
URL: https://github.com/apache/ozone/pull/8918#discussion_r2524730666


##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/ozone/admin/om/OMAdmin.java:
##########
@@ -98,19 +100,28 @@ public OzoneManagerProtocolClientSideTranslatorPB createOmClient(
       String omHost,
       boolean forceHA
   ) throws Exception {
-    OzoneConfiguration conf = parent.getOzoneConf();
+    return createOmClient(parent.getOzoneConf(), parent.getUser(), omServiceID, omHost, forceHA);

Review Comment:
   Looks like the overload of this on line 92 is never used and can be removed. 
   
   



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-13406. Standardize option for OM address for `ozone admin om` [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #8918:
URL: https://github.com/apache/ozone/pull/8918#issuecomment-3527023519

   I just noticed that the new `ozone om admin snapshot defrag` command needs to be updated, too.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-13406. Standardize option for OM address for `ozone admin om` [ozone]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8918:
URL: https://github.com/apache/ozone/pull/8918#issuecomment-3514417841

   This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org