ozone
ozone copied to clipboard
HDDS-10742. Add option to close all pipelines
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):
- get pipeline list from
ScmClient
- filter
CLOSED
pipelines (to close onlyOPEN
andALLOCATED
) - filter pipelines by
REPLICATION
orREPLICATION_TYPE
orREPLICATION_FACTOR
(as in ListPipelinesSubcommand done) - 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.
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 specifiedPIPELINE_ID
, so when user providesPIPELINE_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 onlyEC
or onlyRATIS
pipelines for example.
- Before my changes
ozone admin pipeline close PIPELINE_ID
was working only for specifiedPIPELINE_ID
, so when user providesPIPELINE_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 supportCommandLine.Mixin
for know. I tried to add filters only for a new option--all
. I'l look into int deeper
Hi @Montura apologies for the delay. It's late night here currently but I will check this out tomorrow. Thanks for outlining the options.
Just tried out the suggestions. Once this is done I think we are good to merge 👍
Done!
Thanks @Montura for the patch, @errose28 for the review.