HDDS-11727. Block ozone repair
when a node is running
#7589
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR adds a validation check to ensure that Ozone repair commands are only executed when the relevant services (e.g., OM, SCM, Datanode) are stopped.
check_running_ozone_services
function scans for PID files of running Ozone services.OZONE_RUNNING_SERVICES
.ozone repair om
now validate whetherOM
is running on the host by reading theOZONE_RUNNING_SERVICES
environment variable.OM
is detected as running, the command fails and displays an error message prompting the user to stop theOM
service before proceeding.--force
flag is introduced to allow the user to override this check, useful in false-positive scenarios like co-located services during testing.What is the link to the Apache JIRA
HDDS-11727
How was this patch tested?
OM is detected as running
When OM is detected as running, the repair command throws an error:
Using
--force
to override the checkWhen the
--force
flag is used, the repair command proceeds despite OM being detected as running: