Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

import com.google.common.annotations.VisibleForTesting;
import java.io.IOException;
import java.time.Duration;
import java.time.OffsetDateTime;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
Expand Down Expand Up @@ -459,6 +461,21 @@ private void validateConfiguration(ContainerBalancerConfiguration conf)
"hdds.container.balancer.move.replication.timeout should " +
"be less than hdds.container.balancer.move.timeout.");
}

// (move.timeout - move.replication.timeout - event.timeout.datanode.offset) should be greater than 9 minutes
Comment thread
Tejaskriya marked this conversation as resolved.
Outdated
long datanodeOffset = ozoneConfiguration.getTimeDuration("hdds.scm.replication.event.timeout.datanode.offset",
Duration.ofMinutes(6).toMillis(), TimeUnit.MILLISECONDS);
if ((conf.getMoveTimeout().toMillis() - conf.getMoveReplicationTimeout().toMillis() - datanodeOffset)
< Duration.ofMinutes(9).toMillis()) {
String msg = String.format("(hdds.container.balancer.move.timeout (%sm) - " +
"hdds.container.balancer.move.replication.timeout (%sm) - " +
"hdds.scm.replication.event.timeout.datanode.offset (%sm)) should be greater than 9 minutes.",
Comment thread
Tejaskriya marked this conversation as resolved.
Outdated
conf.getMoveReplicationTimeout().toMinutes(),
conf.getMoveTimeout().toMinutes(),
Duration.ofMillis(datanodeOffset).toMinutes());
LOG.warn(msg);
throw new InvalidContainerBalancerConfigurationException(msg);
}
}

public ContainerBalancerMetrics getMetrics() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void testContainerBalancerCLIOperations() throws Exception {
Optional<Long> maxSizeLeavingSourceInGB = Optional.of(6L);
Optional<Integer> balancingInterval = Optional.of(70);
Optional<Integer> moveTimeout = Optional.of(65);
Optional<Integer> moveReplicationTimeout = Optional.of(55);
Optional<Integer> moveReplicationTimeout = Optional.of(50);
Optional<Boolean> networkTopologyEnable = Optional.of(false);
Optional<String> includeNodes = Optional.of("");
Optional<String> excludeNodes = Optional.of("");
Expand Down Expand Up @@ -147,7 +147,7 @@ public void testIfCBCLIOverridesConfigs() throws Exception {
Optional<Long> maxSizeEnteringTargetInGB = Optional.of(6L);
Optional<Long> maxSizeLeavingSourceInGB = Optional.of(6L);
Optional<Integer> moveTimeout = Optional.of(65);
Optional<Integer> moveReplicationTimeout = Optional.of(55);
Optional<Integer> moveReplicationTimeout = Optional.of(50);
Optional<Boolean> networkTopologyEnable = Optional.of(true);
Optional<String> includeNodes = Optional.of("");
Optional<String> excludeNodes = Optional.of("");
Expand Down