Tejaskriya commented on code in PR #6305:
URL: https://github.com/apache/ozone/pull/6305#discussion_r1519227463


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerTask.java:
##########
@@ -856,19 +860,34 @@ private boolean moveContainer(DatanodeDetails source,
                     " {} failed: {}",
                 moveSelection.getContainerID(), source.getUuidString(),
                 moveSelection.getTargetNode().getUuidString(), result);
+            // add source back if move failed due to container related errors
+            if (result == 
MoveManager.MoveResult.REPLICATION_FAIL_NOT_EXIST_IN_SOURCE ||
+                result == 
MoveManager.MoveResult.REPLICATION_FAIL_EXIST_IN_TARGET ||
+                result == 
MoveManager.MoveResult.REPLICATION_FAIL_CONTAINER_NOT_CLOSED ||
+                result == 
MoveManager.MoveResult.REPLICATION_FAIL_INFLIGHT_DELETION ||
+                result == 
MoveManager.MoveResult.REPLICATION_FAIL_INFLIGHT_REPLICATION) {
+              findSourceStrategy.addBackSourceDataNode(source);
+            }

Review Comment:
   In my understanding, in case the move is completed within one iteration of 
the containerBalancer, then in the next run of the infinite loop wouldn't this 
change would help by adding the source back? What I mean is:
   ```
   ContainerBalancer # doIteration() {
     ...  //this logic runs for each iteration
     while(true) {
       ...
       // in one run of this loop, the source is selected and move is scheduled
       // in some consecutive run, the previous move is completed with false 
result, 
       //         so following current PR changes, the source is added back.
       // so now it can be considered for source selection next time
       ...
     }
     ...
   }
   ```
   If we see in doIteration -> processMoveSelection -> 
updateTargetsAndSelectionCriteria -> the same is done if move was successful. 
   This change simply does the same if move is failing too.



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