ivandika3 commented on code in PR #8542:
URL: https://github.com/apache/ozone/pull/8542#discussion_r3472692095
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java:
##########
@@ -766,6 +764,8 @@ public SCMCommand<?> getNextCommand() {
return command;
}
+ updateCommandStatus(command.getId(),
+ status -> status.setStatus(Status.FAILED));
LOG.warn("Detect and drop a SCMCommand {} from stale leader SCM," +
" stale term {}, latest term {}.",
command, command.getTerm(), currentTerm);
Review Comment:
Yes, functionality is unaffected, but since the previous if already fails
fast, it's odd that the subsequent if is for success.
Usually the code looks like
```java
if (failureCondition1) {
handleFailure1;
}
if (failureCondition2) {
handleFailure2;
}
handleSuccess
```
--
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]