sreejasahithi commented on code in PR #10681:
URL: https://github.com/apache/ozone/pull/10681#discussion_r3576193802


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerTask.java:
##########
@@ -264,8 +277,8 @@ private void balance() {
           return;
         }
         // otherwise, try to stop balancer
-        tryStopWithSaveConfiguration("Could not initialize " +
-            "ContainerBalancer's iteration number " + i);
+        
tryStopWithSaveConfiguration(ContainerBalancerStopReason.INITIALIZATION_FAILED,

Review Comment:
   Yes thanks this is was an important fix missed by me.
   now when init fails it shows something as follows which is the correct 
behaviour:
   
   ```
   bash-5.1$ ozone admin containerbalancer status --verbose --history
   ContainerBalancer is Not Running.
   Stop reason: INITIALIZATION_FAILED
   Message: Failed to initialize a container balancer iteration. Details:  
iteration number 1, Did not find any unbalanced Datanodes.
   Started at: 2026-07-14 05:09:39
   Stopped at: 2026-07-14 05:09:39
   Balancing duration: 0s
   
   Container Balancer Configuration values:
   Key                                                Value
   Threshold                                          10
   Max Datanodes to Involve per Iteration(percent)    20
   Max Size to Move per Iteration                     500GB
   Max Size Entering Target per Iteration             26GB
   Max Size Leaving Source per Iteration              26GB
   Number of Iterations                               10
   Time Limit for Single Container's Movement         65min
   Time Limit for Single Container's Replication      50min
   Interval between each Iteration                    0min
   Whether to Enable Network Topology                 false
   Whether to Trigger Refresh Datanode Usage Info     false
   Container IDs to Include in Balancing              None
   Container IDs to Exclude from Balancing            None
   Datanodes Specified to be Balanced                 None
   Datanodes Excluded from Balancing                  None
   
   Last iteration info:
   -
   
   Completed iteration history:
   -
   ```
   



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