You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "siddhantsangwan (via GitHub)" <gi...@apache.org> on 2023/03/24 07:09:14 UTC
[GitHub] [ozone] siddhantsangwan commented on a diff in pull request #4458: HDDS-8169. Delay Starting ContainerBalancer after SCM failover
siddhantsangwan commented on code in PR #4458:
URL: https://github.com/apache/ozone/pull/4458#discussion_r1147192924
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerTask.java:
##########
@@ -162,6 +167,15 @@ public ContainerBalancerTask(StorageContainerManager scm,
*/
public void run() {
try {
+ if (delayStart) {
+ long delayDuration = ozoneConfiguration.getTimeDuration(
+ "hdds.scm.wait.time.after.safemode.exit",
+ HddsConfigKeys.HDDS_SCM_WAIT_TIME_AFTER_SAFE_MODE_EXIT_DEFAULT,
+ TimeUnit.SECONDS);
+ LOG.info("ContainerBalancer will sleep for {} seconds before starting" +
+ " balancing.", delayDuration);
+ Thread.sleep(Duration.ofSeconds(delayDuration).toMillis());
Review Comment:
Can you clarify why the tests need to wait? None of the tests need to wait for that duration I think, because we're passing in false for that `delayStart` parameter in tests. All except the `testDelayedStart` test in `TestContainerBalancerTask`, which also doesn't need to wait for sleep to finish because we're just checking if the thread went to sleep and then interrupting it. The rest of the tests are taking a similar duration in this branch compared to master.
For testing, we could also just check if that log line `ContainerBalancer will sleep for...` is being logged like in `testDelayedStartOnSCMStatusChange`
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org