peterxcli commented on code in PR #8643:
URL: https://github.com/apache/ozone/pull/8643#discussion_r2152286008


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/ECContainerSafeModeRule.java:
##########
@@ -194,7 +194,6 @@ private void recordReportedContainer(long containerID) {
 
   private void initializeRule() {
     ecContainers.clear();
-    ecContainerDNsMap.clear();

Review Comment:
   Thanks for catching this, I think this is what 
https://issues.apache.org/jira/browse/HDDS-11693 is trying to solve.



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/SetNodeOperationalStateCommandHandler.java:
##########
@@ -92,11 +92,8 @@ public void handle(SCMCommand<?> command, OzoneContainer 
container,
     DatanodeDetails dni = context.getParent().getDatanodeDetails();
     HddsProtos.NodeOperationalState state =
         setNodeCmdProto.getNodeOperationalState();
-    dni.setPersistedOpState(state);
-    dni.setPersistedOpStateExpiryEpochSec(
-        setNodeCmd.getStateExpiryEpochSeconds());
     try {
-      persistDatanodeDetails(dni);
+      persistUpdatedDatanodeDetails(dni, state, 
setNodeCmd.getStateExpiryEpochSeconds());

Review Comment:
   I think this behaviour should be more explicit.
   ```suggestion
         DatanodeDetails persistedDni = new DatanodeDetails(dni)
           .setPersistedOpState(state)
           .setPersistedOpStateExpiryEpochSec(stateExpiryEpochSeconds);
         persistDatanodeDetails(persistedDni);
         // Only update the inmem state if datanodeDetails is persisted 
successfully
         dni.setPersistedOpState(state);
         dni.setPersistedOpStateExpiryEpochSec(stateExpiryEpochSeconds);
   ```



-- 
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]

Reply via email to