You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2018/04/03 23:45:48 UTC

[3/5] impala git commit: IMPALA-6776: Increase region move timeout.

IMPALA-6776: Increase region move timeout.

Some builds are experiencing slow HBase region moves in the
test minicluster. Trying to increase the timeout from 10s to 60s.

Change-Id: Ic62719f1b1aad463bcdc18d0803e780ebb0f8b18
Reviewed-on: http://gerrit.cloudera.org:8080/9892
Reviewed-by: Zach Amsden <za...@cloudera.com>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/6b18b003
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/6b18b003
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/6b18b003

Branch: refs/heads/master
Commit: 6b18b00310fbdae64bc3d8aec0b58385884fe76f
Parents: 0733c8c
Author: Philip Zeyliger <ph...@cloudera.com>
Authored: Sat Mar 31 17:11:28 2018 -0700
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Tue Apr 3 21:41:56 2018 +0000

----------------------------------------------------------------------
 .../HBaseTestDataRegionAssigment.java            | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/6b18b003/testdata/src/compat-minicluster-profile-3/java/org/apache/impala/datagenerator/HBaseTestDataRegionAssigment.java
----------------------------------------------------------------------
diff --git a/testdata/src/compat-minicluster-profile-3/java/org/apache/impala/datagenerator/HBaseTestDataRegionAssigment.java b/testdata/src/compat-minicluster-profile-3/java/org/apache/impala/datagenerator/HBaseTestDataRegionAssigment.java
index fa24146..0f6bbba 100644
--- a/testdata/src/compat-minicluster-profile-3/java/org/apache/impala/datagenerator/HBaseTestDataRegionAssigment.java
+++ b/testdata/src/compat-minicluster-profile-3/java/org/apache/impala/datagenerator/HBaseTestDataRegionAssigment.java
@@ -72,6 +72,8 @@ class HBaseTestDataRegionAssigment {
   // Maximum time in ms to wait for a region to be split.
   private final static int WAIT_FOR_SPLIT_TIMEOUT = 10000;
 
+  private final static int REGION_MOVE_TIMEOUT_MILLIS = 60000;
+
   public HBaseTestDataRegionAssigment() throws IOException {
     conf = new Configuration();
     connection = ConnectionFactory.createConnection(conf);
@@ -162,8 +164,9 @@ class HBaseTestDataRegionAssigment {
     }
 
     // admin.move() is an asynchronous operation. Wait for the move to complete.
-    // It should be done in 10sec.
-    int sleepCnt = 0;
+    // It should be done in 60 sec.
+    long start = System.currentTimeMillis();
+    long timeout = System.currentTimeMillis() + REGION_MOVE_TIMEOUT_MILLIS;
     while (true) {
       int matched = 0;
       List<Pair<RegionInfo, ServerName>> pairs =
@@ -182,14 +185,18 @@ class HBaseTestDataRegionAssigment {
            continue;
         }
       }
-      if (matched == regions.size()) break;
-      if (sleepCnt < 100) {
+      if (matched == regions.size()) {
+        long elapsed = System.currentTimeMillis() - start;
+        LOG.info("Regions moved after " + elapsed + " millis.");
+        break;
+      }
+      if (System.currentTimeMillis() < timeout) {
         Thread.sleep(100);
-        ++sleepCnt;
         continue;
       }
       throw new IllegalStateException(
-          String.format("Failed to assign regions to servers after 10 seconds."));
+          String.format("Failed to assign regions to servers after " +
+            REGION_MOVE_TIMEOUT_MILLIS + " millis."));
     }
 
     // Force a major compaction such that the HBase table is backed by deterministic