You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2019/06/06 04:55:47 UTC

[kudu] branch master updated: KUDU-2670 Disable rowset compact for test of SplitKeyRange

This is an automated email from the ASF dual-hosted git repository.

adar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new cfceb48  KUDU-2670 Disable rowset compact for test of SplitKeyRange
cfceb48 is described below

commit cfceb48511a5aa814dc8a76a51c340ff6edfaaed
Author: oclarms <oc...@gmail.com>
AuthorDate: Wed Jun 5 18:50:26 2019 +0800

    KUDU-2670 Disable rowset compact for test of SplitKeyRange
    
    We found that in the SplitKeyRange related test, in most cases,
    the number of KeyRange is equal to the number of tablets, but we
    expect the number of KeyRange to be greater than the number of tablets.
    
    In the test, the DRS generated by flush MRS will be small, rowset
    compact will merge them to a big one. This will reduce the number
    of DRS in the tablet. If end up with only one DRS in the tablet,
    then the tablet will only have one key range.
    
    So, I added --enable_rowset_compaction=false to disable rowset compact,
    ensure that the number of KeyRange is greater than the number of tablets.
    
    Change-Id: I89805a1fe2fd4d6c459e4abc0b1b9ec27c3e9588
    Reviewed-on: http://gerrit.cloudera.org:8080/13517
    Tested-by: Kudu Jenkins
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
 .../test/java/org/apache/kudu/client/TestSplitKeyRange.java    |  8 +++++---
 .../scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala   | 10 ++++++++--
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestSplitKeyRange.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestSplitKeyRange.java
index 4a52daf..cd718a4 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestSplitKeyRange.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestSplitKeyRange.java
@@ -41,14 +41,16 @@ public class TestSplitKeyRange {
   @Test
   @TabletServerConfig(flags = {
       "--flush_threshold_mb=1",
-      "--flush_threshold_secs=1"
+      "--flush_threshold_secs=1",
+      // Disable rowset compact to prevent DRSs being merged because they are too small.
+      "--enable_rowset_compaction=false"
   })
   public void testSplitKeyRange() throws Exception {
     final KuduTable table = createTableWithOneThousandRows(
         harness.getAsyncClient(), TABLE_NAME, 32 * 1024, DEFAULT_SLEEP);
 
     // Wait for mrs flushed
-    Thread.sleep(10 * 1000);
+    Thread.sleep(5 * 1000);
 
     Schema schema = table.getSchema();
 
@@ -158,7 +160,7 @@ public class TestSplitKeyRange {
         table, primaryKeyStart, primaryKeyEnd, null, null,
         AsyncKuduClient.FETCH_TABLETS_PER_RANGE_LOOKUP,
         1024, DEFAULT_SLEEP).join();
-    assertTrue(keyRanges.size() >= 4);
+    assertTrue(keyRanges.size() > 4);
     for (KeyRange keyRange : keyRanges) {
       int startKey = KeyEncoder.decodePrimaryKey(schema, keyRange.getPrimaryKeyStart()).getInt(0);
       int endKey = KeyEncoder.decodePrimaryKey(schema, keyRange.getPrimaryKeyEnd()).getInt(0);
diff --git a/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala b/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
index 787e13b..4c7e04d 100644
--- a/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
+++ b/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
@@ -1029,10 +1029,16 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
   @TabletServerConfig(
     flags = Array(
       "--flush_threshold_mb=1",
-      "--flush_threshold_secs=1"
+      "--flush_threshold_secs=1",
+      // Disable rowset compact to prevent DRSs being merged because they are too small.
+      "--enable_rowset_compaction=false"
     ))
   def testScanWithKeyRange() {
     upsertRowsWithRowDataSize(table, rowCount * 100, 32 * 1024)
+
+    // Wait for mrs flushed
+    Thread.sleep(5 * 1000)
+
     kuduOptions = Map(
       "kudu.table" -> tableName,
       "kudu.master" -> harness.getMasterAddressesAsString,
@@ -1045,6 +1051,6 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
       val results = sqlContext.sql(s"SELECT * FROM $t").collectAsList()
       assertEquals(rowCount * 100, results.size())
     }
-    assert(actualNumTasks >= 2)
+    assert(actualNumTasks > 2)
   }
 }