devmadhuu commented on code in PR #11230:
URL: https://github.com/apache/ozone/pull/11230#discussion_r4033737172


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ContainerCheckRequest.java:
##########


Review Comment:
   Just a nit and cosmetic , so that no confusion. Earlier the scope of this 
object was just to carry request params through the chain, but now it is also 
holding the container healthstate which gets updated at every exec of handler. 
You can decide if we should rename to something like: `ContainerCheckContext`, 
if not in this PR, follow up PR ?



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManager.java:
##########
@@ -878,10 +876,8 @@ protected boolean processContainer(ContainerInfo 
containerInfo,
       if (!handled) {
         LOG.debug("Container {} had no actions after passing through the " +
             "check chain", containerInfo.containerID());
-        // Container remains HEALTHY (set at start of loop)
       }
-      // Apply final health state from report to container
-      containerInfo.setHealthState(report.getContainerHealthState());
+      containerInfo.setHealthState(checkRequest.getHealthState());

Review Comment:
   Just caught up in this PR, though this is old code behavior. I think we 
should protect this container health state from being overwritten by readonly 
path which usually called by decommission / maintenance workflow calls, so 
there could be a race flip flop for the value. How about if we protect with `if 
(!readOnly)`



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