You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2019/11/22 03:24:19 UTC

[GitHub] [hadoop-ozone] timmylicheng commented on a change in pull request #248: HDDS-2602 Make auto creation for RATIS ONE pipeline configurable.

timmylicheng commented on a change in pull request #248: HDDS-2602 Make auto creation for RATIS ONE pipeline configurable.
URL: https://github.com/apache/hadoop-ozone/pull/248#discussion_r349419600
 
 

 ##########
 File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java
 ##########
 @@ -66,15 +67,43 @@ public void cleanup() {
   @Test(timeout = 180000)
   public void testAutomaticPipelineCreationOnPipelineDestroy()
       throws Exception {
+    int numOfDatanodes = 6;
+    init(numOfDatanodes);
+    // make sure two pipelines are created
+    waitForPipelines(2);
+    Assert.assertEquals(numOfDatanodes, pipelineManager.getPipelines(
+        HddsProtos.ReplicationType.RATIS,
+        HddsProtos.ReplicationFactor.ONE).size());
+
+    List<Pipeline> pipelines = pipelineManager
+        .getPipelines(HddsProtos.ReplicationType.RATIS,
+            HddsProtos.ReplicationFactor.THREE, Pipeline.PipelineState.OPEN);
+    for (Pipeline pipeline : pipelines) {
+      pipelineManager.finalizeAndDestroyPipeline(pipeline, false);
+    }
+    // make sure two pipelines are created
+    waitForPipelines(2);
+  }
+
+  @Test(timeout = 180000)
+  public void testAutomaticPipelineCreationDisablingFactorONE()
+      throws Exception {
+    conf.setBoolean(OZONE_SCM_PIPELINE_AUTO_CREATE_FACTOR_ONE, false);
     init(6);
     // make sure two pipelines are created
     waitForPipelines(2);
+    // No Factor ONE pipeline is auto created.
+    Assert.assertEquals(0, pipelineManager.getPipelines(
+        HddsProtos.ReplicationType.RATIS,
+        HddsProtos.ReplicationFactor.ONE).size());
+
     List<Pipeline> pipelines = pipelineManager
         .getPipelines(HddsProtos.ReplicationType.RATIS,
             HddsProtos.ReplicationFactor.THREE, Pipeline.PipelineState.OPEN);
     for (Pipeline pipeline : pipelines) {
       pipelineManager.finalizeAndDestroyPipeline(pipeline, false);
     }
+
     // make sure two pipelines are created
     waitForPipelines(2);
 
 Review comment:
   I think the original intention was to test if pipeline could be auto created when previous pipelines were closed. Feel like it's still valid to keep future changes in pipeline creation consistence in terms of behaviors. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org