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

   ## What changes were proposed in this pull request?
   
   `ozone repair` shows warning prompt on startup.  HDDS-11945 added logic to 
skip it when showing top-level usage.
   
   This PR further improves it by deferring the prompt to subcommands, so that 
it is not shown for:
   - subcommand invoked without all required options and arguments
   - subcommand invoked with `--help`
   
   Integration tests running `ozone repair` now need to pass `y` to stdin.
   
   https://issues.apache.org/jira/browse/HDDS-12012
   
   ## How was this patch tested?
   
   ```
   $ ozone repair 
   Incomplete command
   Usage: ozone repair [-hV] [--verbose] [-conf=<configurationPath>]
                       [-D=<String=String>]... [COMMAND]
   Advanced tool to repair Ozone. The nodes being repaired must be stopped 
before
   the tool is run.
         -conf=<configurationPath>
   
     -D, --set=<String=String>
   
     -h, --help      Show this help message and exit.
     -V, --version   Print version information and exit.
         --verbose   More verbose output. Show the stack trace of the errors.
   Commands:
     cert-recover  Recover Deleted SCM Certificate from RocksDB
     om            Operational tool to repair OM.
     quota         Operational tool to repair quota in OM DB.
   
   $ ozone repair om 
   Missing required subcommand
   Usage: ozone repair om [COMMAND]
   Operational tool to repair OM.
   Commands:
     fso-tree            Identify and repair a disconnected FSO tree by marking
                           unreferenced entries for deletion. OM should be 
stopped
                           while this tool is run.
     snapshot            Subcommand for all snapshot related repairs.
     update-transaction  CLI to update the highest index in 
transactionInfoTable.
                           Currently it is only supported for OM.
   
   $ ozone repair om fso-tree --help
   Usage: ozone repair om fso-tree [-hrV] [--force] [--verbose] [-b=<bucket>]
                                   --db=<dbPath> [-v=<volume>]
   ...
   
   $ ozone repair om fso-tree
   Missing required option: '--db=<dbPath>'
   Usage: ozone repair om fso-tree [-hrV] [--force] [--verbose] [-b=<bucket>]
                                   --db=<dbPath> [-v=<volume>]
   ...
   
   $ ozone repair om fso-tree --db /data/metadata/om.db
   ATTENTION: Running as user hadoop. Make sure this is the same user used to 
run the Ozone process. Are you sure you want to continue (y/N)? n
   Aborting command.
   
   $ ozone repair om fso-tree --db /data/metadata/om.db
   ATTENTION: Running as user hadoop. Make sure this is the same user used to 
run the Ozone process. Are you sure you want to continue (y/N)? y
   Run as user: hadoop
   Error: OM is currently running on this host with PID 7. Stop the service 
before running the repair tool.
   ```
   
   CI:
   https://github.com/adoroszlai/ozone/actions/runs/12637496667
   


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