sreejasahithi commented on code in PR #9611:
URL: https://github.com/apache/ozone/pull/9611#discussion_r2697944257
##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/SafeModeCheckSubcommand.java:
##########
@@ -33,9 +42,26 @@
mixinStandardHelpOptions = true,
versionProvider = HddsVersionProvider.class)
public class SafeModeCheckSubcommand extends ScmSubcommand {
+ @CommandLine.Option(names = {"--all", "-a"},
+ description = "Show safe mode status for all SCM nodes in the service. "
+
+ "When multiple SCM service IDs are configured, --service-id must be
specified.")
+ private boolean allNodes;
@Override
public void execute(ScmClient scmClient) throws IOException {
+ final OzoneConfiguration conf = getOzoneConf();
+ String serviceId = HddsUtils.getScmServiceId(conf);
+
+ if (allNodes) {
+ executeForAllNodes(scmClient);
+ } else if (StringUtils.isNotEmpty(getScmOption().getScm()) && serviceId !=
null) {
+ executeForSpecificNodeInHA(scmClient, serviceId);
+ } else {
+ executeForSingleNode(scmClient);
Review Comment:
Thanks @ashishkumar50 for finding this bug, now that we are allowing
follower to also accept status command there can be a possibility where when we
run safemode status command with no additional option it can return the status
of the follower.
I have fixed this issue.
--
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]