ozone icon indicating copy to clipboard operation
ozone copied to clipboard

HDDS-10742. Add option to close all pipelines

Open Montura opened this issue 10 months ago • 5 comments

What changes were proposed in this pull request?

For now ozone CLI allows to get pipelines list or close pipeline by PipelineId.

Suggested a new option --all for ClosePipelineSubcommand to close all pipelines (or some filtered pipeline subset):

  1. get pipeline list from ScmClient
  2. filter CLOSED pipelines (to close only OPEN and ALLOCATED)
  3. filter pipelines by REPLICATION or REPLICATION_TYPE or REPLICATION_FACTOR (as in ListPipelinesSubcommand done)
  4. close the remain pipelines set

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-10742

How was this patch tested?

This subcommand triggers ClosePipelineSubcommand that is already tested.

Montura avatar Apr 23 '24 13:04 Montura

  • A command like ozone admin pipeline close --replication=EC 1 will close pipeline 1 even if it is a Ratis pipeline.

    • It would be good to disallow the pipeline filter options when ID is specified, but I'm not sure how easy that is to do with pico CLI.
  • Before my changes ozone admin pipeline close PIPELINE_ID was working only for specified PIPELINE_ID, so when user provides PIPELINE_ID he knows it's replicataion factor and replication type. There were no filters for this command.
  • Filters for replication type and factor appiled only for ozone admin pipeline list --filters command.
  • I thought that it would be nice to add the same filter options when run ozone admin pipeline close --all to be able to close only EC or only RATIS pipelines for example.

Montura avatar Apr 25 '24 06:04 Montura

  • Before my changes ozone admin pipeline close PIPELINE_ID was working only for specified PIPELINE_ID, so when user provides PIPELINE_ID he knows it's replicataion factor and replication type. There were no filters for this command.

I realized, @errose28 means that you call ozone admin close pipeline 1 --replication=EC and filter is ignored...

Maybe a message like When close pipeline by ID filters are ignored. will solve this issue for a while?

  • CommandLine.ArgGroup doesn't support CommandLine.Mixin for know. I tried to add filters only for a new option --all. I'l look into int deeper

Montura avatar Apr 25 '24 06:04 Montura

Hi @Montura apologies for the delay. It's late night here currently but I will check this out tomorrow. Thanks for outlining the options.

errose28 avatar May 08 '24 05:05 errose28

Just tried out the suggestions. Once this is done I think we are good to merge 👍

errose28 avatar May 09 '24 00:05 errose28

Done!

Montura avatar May 09 '24 08:05 Montura

Thanks @Montura for the patch, @errose28 for the review.

adoroszlai avatar May 10 '24 08:05 adoroszlai