浏览代码

HDFS-11620. Ozone: Allocate container for MiniOzone cluster fails because of insufficient space error. Contributed by Mukul Kumar Singh.

Anu Engineer 8 年之前
父节点
当前提交
38dddad74e

+ 3 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/placement/algorithms/SCMCommonPolicy.java

@@ -125,8 +125,9 @@ public abstract class SCMCommonPolicy implements ContainerPlacementPolicy {
 
     if (healthyList.size() < nodesRequired) {
       msg = String.format("Unable to find enough nodes that meet the space " +
-              "requirement in healthy node set. Nodes required: %d Found: %d",
-          nodesRequired, healthyList.size());
+              "requirement of %d bytes in healthy node set." +
+              " Nodes required: %d Found: %d",
+          sizeRequired, nodesRequired, healthyList.size());
       LOG.error(msg);
       throw new SCMException(msg,
           SCMException.ResultCodes.FAILED_TO_FIND_NODES_WITH_SPACE);

+ 1 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java

@@ -354,6 +354,7 @@ public final class MiniOzoneCluster extends MiniDFSCluster
         if (waitForChillModeFinish) {
           cluster.waitTobeOutOfChillMode();
         }
+        cluster.waitForHeartbeatProcessed();
       } catch (Exception e) {
         // A workaround to propagate MiniOzoneCluster failures without
         // changing the method signature (which would require cascading