You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bu...@apache.org on 2017/08/22 06:13:00 UTC

[01/11] hbase git commit: HBASE-18629 Enhance ChaosMonkeyRunner with interruptibility [Forced Update!]

Repository: hbase
Updated Branches:
  refs/heads/HBASE-18467 0906d33c8 -> 39aff5114 (forced update)


HBASE-18629 Enhance ChaosMonkeyRunner with interruptibility


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/192e8730
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/192e8730
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/192e8730

Branch: refs/heads/HBASE-18467
Commit: 192e87309e387ef9fdf7f9808d221ca28ab69889
Parents: 820ee91
Author: tedyu <yu...@gmail.com>
Authored: Mon Aug 21 08:44:11 2017 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Mon Aug 21 08:44:11 2017 -0700

----------------------------------------------------------------------
 .../hbase/chaos/util/ChaosMonkeyRunner.java     | 26 ++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/192e8730/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
index 82c51ad..f142321 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
@@ -52,6 +52,7 @@ public class ChaosMonkeyRunner extends AbstractHBaseTool {
   protected boolean noClusterCleanUp = false;
   private String tableName = "ChaosMonkeyRunner.tableName";
   private String familyName = "ChaosMonkeyRunner.familyName";
+  private volatile boolean stop = false;
 
   @Override
   public void addOptions() {
@@ -92,9 +93,14 @@ public class ChaosMonkeyRunner extends AbstractHBaseTool {
   protected int doWork() throws Exception {
     setUpCluster();
     getAndStartMonkey();
-    while (true) {// loop here until got killed
+    while (!stop) {// loop here until got killed
       Thread.sleep(10000);
     }
+    return 0;
+  }
+
+  public void stopRunner() {
+    stop = true;
   }
 
   public void setUpCluster() throws Exception {
@@ -151,10 +157,26 @@ public class ChaosMonkeyRunner extends AbstractHBaseTool {
     return Sets.newHashSet(familyName);
   }
 
+  /*
+   * If caller wants to add config parameters contained in a file, the path of conf file
+   * can be passed as the first two arguments like this:
+   *   -c <path-to-conf>
+   */
   public static void main(String[] args) throws Exception {
     Configuration conf = HBaseConfiguration.create();
+    String[] actualArgs = args;
+    if (args.length > 0 && "-c".equals(args[0])) {
+      int argCount = args.length - 2;
+      if (argCount < 0) {
+        throw new IllegalArgumentException("Missing path for -c parameter");
+      }
+      // load the resource specified by the second parameter
+      conf.addResource(args[1]);
+      actualArgs = new String[argCount];
+      System.arraycopy(args, 2, actualArgs, 0, argCount);
+    }
     IntegrationTestingUtility.setUseDistributedCluster(conf);
-    int ret = ToolRunner.run(conf, new ChaosMonkeyRunner(), args);
+    int ret = ToolRunner.run(conf, new ChaosMonkeyRunner(), actualArgs);
     System.exit(ret);
   }
 

[03/11] hbase git commit: HBASE-18629 Enhance ChaosMonkeyRunner with interruptibility - addendum makes stopRunner() static

Posted by bu...@apache.org.
HBASE-18629 Enhance ChaosMonkeyRunner with interruptibility - addendum makes stopRunner() static


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

Branch: refs/heads/HBASE-18467
Commit: fef7e8f7e8242b87f6e1c6b4b8df440af8ca6da5
Parents: 70d48b1
Author: tedyu <yu...@gmail.com>
Authored: Mon Aug 21 09:37:30 2017 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Mon Aug 21 09:37:30 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java   | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/fef7e8f7/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
index f142321..80f99e5 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
@@ -45,6 +45,8 @@ public class ChaosMonkeyRunner extends AbstractHBaseTool {
   public static final String TABLE_NAME_OPT = "tableName";
   public static final String FAMILY_NAME_OPT = "familyName";
 
+  private static ChaosMonkeyRunner runner;
+
   protected IntegrationTestingUtility util;
   protected ChaosMonkey monkey;
   protected String monkeyToUse;
@@ -99,8 +101,8 @@ public class ChaosMonkeyRunner extends AbstractHBaseTool {
     return 0;
   }
 
-  public void stopRunner() {
-    stop = true;
+  public static void stopRunner() {
+    runner.stop = true;
   }
 
   public void setUpCluster() throws Exception {
@@ -176,7 +178,8 @@ public class ChaosMonkeyRunner extends AbstractHBaseTool {
       System.arraycopy(args, 2, actualArgs, 0, argCount);
     }
     IntegrationTestingUtility.setUseDistributedCluster(conf);
-    int ret = ToolRunner.run(conf, new ChaosMonkeyRunner(), actualArgs);
+    runner = new ChaosMonkeyRunner();
+    int ret = ToolRunner.run(conf, runner, actualArgs);
     System.exit(ret);
   }
 


[05/11] hbase git commit: HBASE-Fix client.TestClientClusterStatus (Chia-Ping Tsai)

Posted by bu...@apache.org.
HBASE-Fix client.TestClientClusterStatus (Chia-Ping Tsai)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/7b3291fa
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/7b3291fa
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/7b3291fa

Branch: refs/heads/HBASE-18467
Commit: 7b3291fa8b836be9539817876799994fac5de335
Parents: 70da554
Author: Michael Stack <st...@apache.org>
Authored: Mon Aug 21 14:21:30 2017 -0700
Committer: Michael Stack <st...@apache.org>
Committed: Mon Aug 21 14:21:30 2017 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/client/TestClientClusterStatus.java      | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/7b3291fa/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
index 49b4ff2..484ee06 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
@@ -65,7 +65,7 @@ public class TestClientClusterStatus {
     RegionServerThread rst = rsts.get(rsts.size() - 1);
     DEAD = rst.getRegionServer();
     DEAD.stop("Test dead servers status");
-    while (!DEAD.isStopped()) {
+    while (rst.isAlive()) {
       Thread.sleep(500);
     }
   }
@@ -155,9 +155,11 @@ public class TestClientClusterStatus {
     Assert.assertNotNull(status);
     Assert.assertNotNull(status.getServers());
     // exclude a dead region server
-    Assert.assertEquals(SLAVES, numRs);
-    // live servers = primary master + nums of regionservers
-    Assert.assertEquals(status.getServers().size() + 1 /*Master*/, numRs);
+    Assert.assertEquals(SLAVES -1, numRs);
+    // live servers = nums of regionservers
+    // By default, HMaster don't carry any regions so it won't report its load.
+    // Hence, it won't be in the server list.
+    Assert.assertEquals(status.getServers().size(), numRs);
     Assert.assertTrue(status.getRegionsCount() > 0);
     Assert.assertNotNull(status.getDeadServerNames());
     Assert.assertEquals(1, status.getDeadServersSize());


[02/11] hbase git commit: HBASE-18623 Frequent failed to parse at EOF warnings from WALEntryStream

Posted by bu...@apache.org.
HBASE-18623 Frequent failed to parse at EOF warnings from WALEntryStream


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/70d48b11
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/70d48b11
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/70d48b11

Branch: refs/heads/HBASE-18467
Commit: 70d48b113e3b824e2804164e80edf01522c85272
Parents: 192e873
Author: Andrew Purtell <ap...@apache.org>
Authored: Fri Aug 18 17:13:51 2017 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Mon Aug 21 09:29:24 2017 -0700

----------------------------------------------------------------------
 .../hbase/replication/regionserver/WALEntryStream.java       | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/70d48b11/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStream.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStream.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStream.java
index 4f49955..3942d23 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStream.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStream.java
@@ -233,9 +233,11 @@ public class WALEntryStream implements Iterator<Entry>, Closeable, Iterable<Entr
       if (trailerSize < 0) {
         if (currentPosition < stat.getLen()) {
           final long skippedBytes = stat.getLen() - currentPosition;
-          LOG.info("Reached the end of WAL file '" + currentPath
-              + "'. It was not closed cleanly, so we did not parse " + skippedBytes
-              + " bytes of data.");
+          if (LOG.isDebugEnabled()) {
+            LOG.debug("Reached the end of WAL file '" + currentPath
+                + "'. It was not closed cleanly, so we did not parse " + skippedBytes
+                + " bytes of data. This is normally ok.");
+          }
           metrics.incrUncleanlyClosedWALs();
           metrics.incrBytesSkippedInUncleanlyClosedWALs(skippedBytes);
         }

[04/11] hbase git commit: HBASE-18629 Enhance ChaosMonkeyRunner with interruptibility - revert addendum

Posted by bu...@apache.org.
HBASE-18629 Enhance ChaosMonkeyRunner with interruptibility - revert addendum


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/70da5541
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/70da5541
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/70da5541

Branch: refs/heads/HBASE-18467
Commit: 70da554183213778911d3ed0537402c6cfeab173
Parents: fef7e8f
Author: tedyu <yu...@gmail.com>
Authored: Mon Aug 21 10:01:42 2017 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Mon Aug 21 10:01:42 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java   | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/70da5541/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
index 80f99e5..f142321 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java
@@ -45,8 +45,6 @@ public class ChaosMonkeyRunner extends AbstractHBaseTool {
   public static final String TABLE_NAME_OPT = "tableName";
   public static final String FAMILY_NAME_OPT = "familyName";
 
-  private static ChaosMonkeyRunner runner;
-
   protected IntegrationTestingUtility util;
   protected ChaosMonkey monkey;
   protected String monkeyToUse;
@@ -101,8 +99,8 @@ public class ChaosMonkeyRunner extends AbstractHBaseTool {
     return 0;
   }
 
-  public static void stopRunner() {
-    runner.stop = true;
+  public void stopRunner() {
+    stop = true;
   }
 
   public void setUpCluster() throws Exception {
@@ -178,8 +176,7 @@ public class ChaosMonkeyRunner extends AbstractHBaseTool {
       System.arraycopy(args, 2, actualArgs, 0, argCount);
     }
     IntegrationTestingUtility.setUseDistributedCluster(conf);
-    runner = new ChaosMonkeyRunner();
-    int ret = ToolRunner.run(conf, runner, actualArgs);
+    int ret = ToolRunner.run(conf, new ChaosMonkeyRunner(), actualArgs);
     System.exit(ret);
   }
 

[08/11] hbase git commit: HBASE-18627 Fix TestRegionServerReadRequestMetrics (Chia-Ping Tsai)

Posted by bu...@apache.org.
HBASE-18627 Fix TestRegionServerReadRequestMetrics (Chia-Ping Tsai)


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

Branch: refs/heads/HBASE-18467
Commit: bf343da4a445cd9ed1da953e2b24861a5b869846
Parents: 078a6be
Author: Michael Stack <st...@apache.org>
Authored: Mon Aug 21 15:38:15 2017 -0700
Committer: Michael Stack <st...@apache.org>
Committed: Mon Aug 21 15:38:15 2017 -0700

----------------------------------------------------------------------
 .../hbase/regionserver/TestRegionServerReadRequestMetrics.java     | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/bf343da4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReadRequestMetrics.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReadRequestMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReadRequestMetrics.java
index 297aa50..2cd1559 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReadRequestMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReadRequestMetrics.java
@@ -89,6 +89,8 @@ public class TestRegionServerReadRequestMetrics {
   @BeforeClass
   public static void setUpOnce() throws Exception {
     // Default starts one regionserver only.
+    TEST_UTIL.getConfiguration().setBoolean(LoadBalancer.TABLES_ON_MASTER, true);
+    TEST_UTIL.getConfiguration().setBoolean(LoadBalancer.SYSTEM_TABLES_ON_MASTER, true);
     TEST_UTIL.startMiniCluster();
     admin = TEST_UTIL.getAdmin();
     serverNames = admin.getClusterStatus().getServers();

[07/11] hbase git commit: HBASE-18634 HBASE-Fix client.TestClientClusterStatus (Chia-Ping Tsai) This is a revert of a revert; i.e. a reapply just to fix commit message.

Posted by bu...@apache.org.
HBASE-18634 HBASE-Fix client.TestClientClusterStatus (Chia-Ping Tsai)
This is a revert of a revert; i.e. a reapply just to fix commit message.

This reverts commit fbbae8774ca3162245c0d883c9f477f7d92bc8a5.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/078a6be7
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/078a6be7
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/078a6be7

Branch: refs/heads/HBASE-18467
Commit: 078a6be7d0ccd370016ba351090e21ea0e041e86
Parents: fbbae87
Author: Michael Stack <st...@apache.org>
Authored: Mon Aug 21 14:38:58 2017 -0700
Committer: Michael Stack <st...@apache.org>
Committed: Mon Aug 21 14:38:58 2017 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/client/TestClientClusterStatus.java      | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/078a6be7/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
index 49b4ff2..484ee06 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
@@ -65,7 +65,7 @@ public class TestClientClusterStatus {
     RegionServerThread rst = rsts.get(rsts.size() - 1);
     DEAD = rst.getRegionServer();
     DEAD.stop("Test dead servers status");
-    while (!DEAD.isStopped()) {
+    while (rst.isAlive()) {
       Thread.sleep(500);
     }
   }
@@ -155,9 +155,11 @@ public class TestClientClusterStatus {
     Assert.assertNotNull(status);
     Assert.assertNotNull(status.getServers());
     // exclude a dead region server
-    Assert.assertEquals(SLAVES, numRs);
-    // live servers = primary master + nums of regionservers
-    Assert.assertEquals(status.getServers().size() + 1 /*Master*/, numRs);
+    Assert.assertEquals(SLAVES -1, numRs);
+    // live servers = nums of regionservers
+    // By default, HMaster don't carry any regions so it won't report its load.
+    // Hence, it won't be in the server list.
+    Assert.assertEquals(status.getServers().size(), numRs);
     Assert.assertTrue(status.getRegionsCount() > 0);
     Assert.assertNotNull(status.getDeadServerNames());
     Assert.assertEquals(1, status.getDeadServersSize());


[11/11] hbase git commit: HBASE-18467 WIP build up a jira comment.

Posted by bu...@apache.org.
HBASE-18467 WIP build up a jira comment.

HBASE-18467 WIP fail yetus checks instead of running.

WIP fixing syntax.

WIP switch to non-jenkins substituded string.

WIP adding attempt at using jira selector after all.

HBASE-18467 make sure placeholder failure for yetus writes console report.

HBASE-18467 more syntax.

HBASE-18467 WIP let's try using the changeset directly.

HBASE-18467 WIP assemble comment contents.

HBASE-18467 WIP, doesn't look like newlines are cool with groovy.

HBASE-18467 WIP ah, it was that you can't have newlines in var names.

HBASE-18467 WIP more debugging. ugh.

HBASE-18467 WIP

HBASE-18467 attempt at using jiraComment.

HBASE-18467 correct naming the output file for comments. correctly join the list of results.

HBASE-18467 fixing substitutions. debug output of changeSets

HBASE-18467 delete result files from prior runs.

HBASE-18467 GitChangeSetList doesn't have a size.

HBASE-18467 just remove attempts to see the size of the changeset.

HBASE-18467 add a note for when the changeset is empty.

HBASE-18467 cleanup.

HBASE_18467 more debug info. :/ jenkins groovy is miserable.

HBASE-18467 remove anything other than interating over the changeset.

HBASE-18467 add back in a .size call at Andrew B's request.

HBASE-18467 result of help from Andrew B.

HBASE-18467 output a bit about each scm's changelist.

HBASE-18467 ugh.

HBASE-18467 just use methods from ChangeLogSet.Entry

HBASE-18467 switch to ubuntu label instead of Hadoop.

HBASE-18467 more change information. some debug about message.

HBASE-18467 just print all the methods on change, since the javadocs are wrong.

HBASE-18467 more change output.

HBASE-18467 typo.

HBASE-18467 removing currentRevision since it doesn't seem to exist.

HBASE-18467 grasping at straws.

HBASE-18467 figure out what part of findAll is failing.

HBASE-18467 remove some debug entries we no longer need.

HBASE-18467 switch to eachMatch instead of findAll().each

HBASE-18467 mark end of iterating.

HBASE-18467 maybe pattern isn't a Pattern?


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/39aff511
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/39aff511
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/39aff511

Branch: refs/heads/HBASE-18467
Commit: 39aff5114ed2f16bd02a865afe6a384333895e52
Parents: 23ddf69
Author: Sean Busbey <bu...@apache.org>
Authored: Wed Aug 9 00:48:46 2017 -0500
Committer: Sean Busbey <bu...@apache.org>
Committed: Tue Aug 22 01:12:43 2017 -0500

----------------------------------------------------------------------
 dev-support/Jenkinsfile            | 138 ++++++++++++++++++++++++++++++--
 dev-support/hbase_nightly_yetus.sh |   7 ++
 2 files changed, 138 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/39aff511/dev-support/Jenkinsfile
----------------------------------------------------------------------
diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile
index 1f01a47..8876e5f 100644
--- a/dev-support/Jenkinsfile
+++ b/dev-support/Jenkinsfile
@@ -17,7 +17,9 @@
 pipeline {
   agent {
     node {
-      label 'Hadoop'
+//      label 'Hadoop'
+// temp go to ubuntu since it seems like no one uses those
+      label 'ubuntu'
     }
   }
   triggers {
@@ -128,7 +130,18 @@ curl -L  -o personality.sh "${env.PROJET_PERSONALITY}"
       steps {
         unstash 'yetus'
         // TODO should this be a download from master, similar to how the personality is?
-        sh "${env.BASEDIR}/dev-support/hbase_nightly_yetus.sh"
+        sh '''#!/usr/bin/env bash
+          rm -f "${OUTPUTDIR}/success" "${OUTPUTDIR}/failure"
+          declare commentfile
+          if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then
+            commentfile="${OUTPUTDIR}/success"
+            echo '(/) *{color:green}+1 general checks{color}*' >> "${commentfile}"
+          else
+            commentfile="${OUTPUTDIR}/failure"
+            echo '(x) *{color:red}-1 general checks{color}*' >> "${commentfile}"
+          fi
+          echo "-- For more information [see general report|${BUILD_URL}/General_Nightly_Build_Report/]" >> "${commentfile}"
+        '''
       }
       post {
         always {
@@ -159,13 +172,22 @@ curl -L  -o personality.sh "${env.PROJET_PERSONALITY}"
       }
       steps {
         unstash 'yetus'
-        sh """#!/usr/bin/env bash
+        sh '''#!/usr/bin/env bash
           # for branch-1.1 we don't do jdk8 findbugs, so do it here
-          if [ "${env.BRANCH_NAME}" == "branch-1.1" ]; then
+          if [ "${BRANCH_NAME}" == "branch-1.1" ]; then
             TESTS+=",findbugs"
           fi
-          "${env.BASEDIR}/dev-support/hbase_nightly_yetus.sh"
-        """
+          declare commentfile
+          rm -f "${OUTPUTDIR}/success" "${OUTPUTDIR}/failure"
+          if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then
+            commentfile="${OUTPUTDIR}/success"
+            echo '(/) *{color:green}+1 jdk7 checks{color}*' >> "${commentfile}"
+          else
+            commentfile="${OUTPUTDIR}/failure"
+            echo '(x) *{color:red}-1 jdk7 checks{color}*' >> "${commentfile}"
+          fi
+          echo "-- For more information [see jdk7 report|${BUILD_URL}/JDK7_Nightly_Build_Report/]" >> "${commentfile}"
+        '''
       }
       post {
         always {
@@ -215,7 +237,18 @@ curl -L  -o personality.sh "${env.PROJET_PERSONALITY}"
       }
       steps {
         unstash 'yetus'
-        sh "${env.BASEDIR}/dev-support/hbase_nightly_yetus.sh"
+        sh '''#!/usr/bin/env bash
+          declare commentfile
+          rm -f "${OUTPUTDIR}/success" "${OUTPUTDIR}/failure"
+          if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then
+            commentfile="${OUTPUTDIR}/success"
+            echo '(/) *{color:green}+1 jdk8 checks{color}*' >> "${commentfile}"
+          else
+            commentfile="${OUTPUTDIR}/failure"
+            echo '(x) *{color:red}-1 jdk8 checks{color}*' >> "${commentfile}"
+          fi
+          echo "-- For more information [see jdk8 report|${BUILD_URL}/JDK8_Nightly_Build_Report/]" >> "${commentfile}"
+        '''
       }
       post {
         always {
@@ -287,6 +320,7 @@ curl -L  -o personality.sh "${env.PROJET_PERSONALITY}"
         }
         // expectation check largely based on HBASE-14952
         sh '''#!/bin/bash -e
+          rm -rf "${env.WORKSPACE}/src_tarball_success" "${env.WORKSPACE}/src_tarball_failure"
           echo "Checking against things we don't expect to include in the source tarball (git related, hbase-native-client, etc.)"
           cat >known_excluded <<END
 Only in .: .git
@@ -304,6 +338,96 @@ END
           fi
 '''
       }
+      // This approach only works because the source release artifact is the last stage that does work.
+      post {
+        success {
+          writeFile file: "${env.WORKSPACE}/src_tarball_success", text: '(/) *{color:green}+1 source release artifact{color}*'
+        }
+        failure {
+          writeFile file: "${env.WORKSPACE}/src_tarball_failure", text: '(x) *{color:red}-1 source release artifact{color}*'
+        }
+      }
+    }
+    stage ('Fail if previous stages failed') {
+      steps {
+        script {
+          def failures = ['src_tarball_failure', "${env.OUTPUT_RELATIVE_GENERAL}/failure",
+                          "${env.OUTPUT_RELATIVE_JDK7}/failure", "${OUTPUT_RELATIVE_JDK8}/failure"]
+          for ( failure_file in failures ) {
+            if (fileExists(file: failure_file)) {
+              error 'Failing job due to previous failure(s) in prior steps.'
+            }
+          }
+        }
+      }
+    }
+  }
+  post {
+    always {
+      script {
+         sh "printenv"
+         def results = ["${env.OUTPUT_RELATIVE_GENERAL}/failure", "${env.OUTPUT_RELATIVE_GENERAL}/success",
+                        "${env.OUTPUT_RELATIVE_JDK7}/failure", "${env.OUTPUT_RELATIVE_JDK7}/success",
+                        "${env.OUTPUT_RELATIVE_JDK8}/failure", "${env.OUTPUT_RELATIVE_JDK8}/success",
+                        'src_tarball_failure', 'src_tarball_success']
+         echo env.BRANCH_NAME
+         echo env.BUILD_URL
+         echo currentBuild.result
+         echo currentBuild.durationString
+         def comment = "Results for branch ${env.BRANCH_NAME}, done in ${currentBuild.durationString}\n"
+         if (currentBuild.result == "SUCCESS") {
+            comment += '	(/) *{color:green}+1 overall{color}*\\'
+         } else {
+            comment += '(x) *{color:red}-1 overall{color}*\\'
+            // Ideally get the committer our of the change and @ mention them in the per-jira comment
+            comment += 'Committer, please check your recent inclusion of a patch for this issue.\\'
+         }
+         comment += "	[build ${currentBuild.displayName} on builds.a.o|${env.BUILD_URL}]: ${currentBuild.result}\\----\\details (if available):\n"
+         //echo "[DEBUG] Comment so far: "
+         //echo comment
+         echo ""
+         echo "[DEBUG] trying to aggregate step-wise results"
+         comment += results.collect { fileExists(file: it) ? readFile(file: it) : "" }.join("\n")
+         echo "[INFO] Comment:"
+         echo comment
+         echo ""
+         echo "[INFO] There are ${currentBuild.changeSets.size()} change sets."
+         def seenJiras = []
+         for ( changelist in currentBuild.changeSets ) {
+           if ( changelist.isEmptySet() ) {
+             echo "[DEBUG] change set was empty, skipping JIRA comments."
+           } else {
+             echo "[DEBUG] there are changes in the change set. Attempting to post comments."
+           }
+           for ( change in changelist ) {
+             def msg = change.msg
+             echo "[DEBUG] msg is of class ${msg.class}"
+             echo "change: ${change}"
+             echo "     ${msg}"
+             echo "	${change.commitId}"
+             echo "     ${change.author}"
+             echo ""
+             def pattern = /HBASE-[0-9]+/
+             echo "pattern (${pattern.class}): ${pattern}"
+             echo "eachMatch:"
+             msg.eachMatch(pattern) {
+               echo "	${it}"
+             }
+             echo "/eachMatch"
+             msg.findAll( /HBASE-[0-9]+/ ).each { currentIssue ->
+               echo "[DEBUG] found jira key: ${currentIssue}"
+               if ( currentIssue in seenJiras ) {
+                 echo "[DEBUG] already commented on ${currentIssue}."
+               } else {
+                 echo "[INFO] commenting on ${currentIssue}."
+                 jiraComment issueKey: currentIssue, body: comment
+                 seenJiras << currentIssue
+               }
+             }
+             //TODO warn if no JIRA key found in message, email committer
+           }
+         }
+      }
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/39aff511/dev-support/hbase_nightly_yetus.sh
----------------------------------------------------------------------
diff --git a/dev-support/hbase_nightly_yetus.sh b/dev-support/hbase_nightly_yetus.sh
index 007d64a..5920a81 100755
--- a/dev-support/hbase_nightly_yetus.sh
+++ b/dev-support/hbase_nightly_yetus.sh
@@ -16,6 +16,13 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# XXX Don't commit this part.
+# fail fast
+mkdir -p "${OUTPUTDIR}"
+echo "placeholder" >> "${OUTPUTDIR}/console-report.html"
+exit 1772
+# /XXX Don't commit this part.
+
 declare -i missing_env=0
 # Validate params
 for required_env in "TESTS" "TOOLS" "BASEDIR" "ARCHIVE_PATTERN_LIST" "OUTPUT_RELATIVE" \

[09/11] hbase git commit: HBASE-18103 [AMv2] Changed master to throw YouAreDeadException when it receives regionServerReport() with incorrect region assignment. Added test to verify rogue region server behavior.

Posted by bu...@apache.org.
HBASE-18103 [AMv2] Changed master to throw YouAreDeadException when it receives regionServerReport() with incorrect region assignment. Added test to verify rogue region server behavior.

Behavior prior to these changes is to call expireServer(), log exception and suppress it. These changes will result in RS receiving the YouAreDeadException and treating it as a fatal error. This 'fail fast' approach will help us stabilize the code. This behavior can be reconsidered later if necessary.

Signed-off-by: Michael Stack <st...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5895538a
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5895538a
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5895538a

Branch: refs/heads/HBASE-18467
Commit: 5895538a32d6bd2d7153e38304523caf6ea7579c
Parents: bf343da
Author: Umesh Agashe <ua...@cloudera.com>
Authored: Fri Aug 18 14:28:00 2017 -0700
Committer: Michael Stack <st...@apache.org>
Committed: Mon Aug 21 17:23:10 2017 -0700

----------------------------------------------------------------------
 .../master/assignment/AssignmentManager.java    |   7 +-
 .../master/assignment/MockMasterServices.java   |   9 +-
 .../assignment/TestRogueRSAssignment.java       | 192 +++++++++++++++++++
 3 files changed, 204 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5895538a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
index 0b23f47..6a9cfc2 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
@@ -46,6 +46,7 @@ import org.apache.hadoop.hbase.RegionException;
 import org.apache.hadoop.hbase.RegionStateListener;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.YouAreDeadException;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.client.TableState;
 import org.apache.hadoop.hbase.exceptions.UnexpectedStateException;
@@ -895,7 +896,7 @@ public class AssignmentManager implements ServerListener {
    * that something went wrong on the RS side.
    */
   public void reportOnlineRegions(final ServerName serverName,
-      final int versionNumber, final Set<byte[]> regionNames) {
+      final int versionNumber, final Set<byte[]> regionNames) throws YouAreDeadException {
     if (!isRunning()) return;
     if (LOG.isTraceEnabled()) {
       LOG.trace("ReportOnlineRegions " + serverName + " regionCount=" + regionNames.size() +
@@ -959,7 +960,8 @@ public class AssignmentManager implements ServerListener {
     }
   }
 
-  void checkOnlineRegionsReport(final ServerStateNode serverNode, final Set<byte[]> regionNames) {
+  void checkOnlineRegionsReport(final ServerStateNode serverNode, final Set<byte[]> regionNames)
+      throws YouAreDeadException {
     final ServerName serverName = serverNode.getServerName();
     try {
       for (byte[] regionName: regionNames) {
@@ -999,6 +1001,7 @@ public class AssignmentManager implements ServerListener {
     } catch (UnexpectedStateException e) {
       LOG.warn("Killing " + serverName + ": " + e.getMessage());
       killRegionServer(serverNode);
+      throw (YouAreDeadException)new YouAreDeadException(e.getMessage()).initCause(e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/5895538a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/MockMasterServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/MockMasterServices.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/MockMasterServices.java
index d558aaf..48386a6 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/MockMasterServices.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/MockMasterServices.java
@@ -34,6 +34,7 @@ import org.apache.hadoop.hbase.ServerLoad;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableDescriptors;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.YouAreDeadException;
 import org.apache.hadoop.hbase.client.ClusterConnection;
 import org.apache.hadoop.hbase.client.HConnectionTestingUtility;
 import org.apache.hadoop.hbase.master.LoadBalancer;
@@ -115,8 +116,12 @@ public class MockMasterServices extends MockNoopMasterServices {
       protected boolean waitServerReportEvent(ServerName serverName, Procedure proc) {
         // Make a report with current state of the server 'serverName' before we call wait..
         SortedSet<byte []> regions = regionsToRegionServers.get(serverName);
-        getAssignmentManager().reportOnlineRegions(serverName, 0,
-            regions == null? new HashSet<byte []>(): regions);
+        try {
+          getAssignmentManager().reportOnlineRegions(serverName, 0,
+              regions == null? new HashSet<byte []>(): regions);
+        } catch (YouAreDeadException e) {
+          throw new RuntimeException(e);
+        }
         return super.waitServerReportEvent(serverName, proc);
       }
     };

http://git-wip-us.apache.org/repos/asf/hbase/blob/5895538a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRogueRSAssignment.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRogueRSAssignment.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRogueRSAssignment.java
new file mode 100644
index 0000000..49eb573
--- /dev/null
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRogueRSAssignment.java
@@ -0,0 +1,192 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.master.assignment;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.MiniHBaseCluster;
+import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.YouAreDeadException;
+import org.apache.hadoop.hbase.client.Admin;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
+import org.apache.hadoop.hbase.master.HMaster;
+import org.apache.hadoop.hbase.master.procedure.MasterProcedureConstants;
+import org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException;
+import org.apache.hadoop.hbase.shaded.com.google.protobuf.UnsafeByteOperations;
+import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos;
+import org.apache.hadoop.hbase.testclassification.MasterTests;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.ExpectedException;
+import org.junit.rules.TestName;
+
+import java.io.IOException;
+import java.util.List;
+
+import static org.hamcrest.core.Is.isA;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Tests to verify master/ assignment manager functionality against rogue RS
+ */
+@Category({MasterTests.class, MediumTests.class})
+public class TestRogueRSAssignment {
+  private static final Log LOG = LogFactory.getLog(TestRogueRSAssignment.class);
+
+  @Rule
+  public final TestName name = new TestName();
+
+  @Rule
+  public ExpectedException exception = ExpectedException.none();
+  private static final int initialRegionCount = 3;
+  private final static byte[] FAMILY = Bytes.toBytes("FAMILY");
+
+  private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
+  private static final Configuration conf = UTIL.getConfiguration();
+  private static Admin admin;
+  private static MiniHBaseCluster cluster;
+  private static HMaster master;
+
+  private static void setupConf(Configuration conf) {
+    // Reduce the maximum attempts to speed up the test
+    conf.setInt("hbase.assignment.maximum.attempts", 3);
+    conf.setInt("hbase.master.maximum.ping.server.attempts", 3);
+    conf.setInt("hbase.master.ping.server.retry.sleep.interval", 1);
+    conf.setInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 1);
+  }
+
+  @BeforeClass
+  public static void setupCluster() throws Exception {
+    setupConf(conf);
+    UTIL.startMiniCluster(2);
+
+    cluster = UTIL.getHBaseCluster();
+    assertNotNull(cluster);
+
+    admin = UTIL.getAdmin();
+    assertNotNull(admin);
+
+    master = cluster.getMaster();
+    assertNotNull(master);
+  }
+
+  @AfterClass
+  public static void cleanupTest() throws Exception {
+    try {
+      UTIL.shutdownMiniCluster();
+      cluster = null;
+      admin = null;
+    } catch (Exception e) {
+      LOG.warn("failure shutting down cluster", e);
+    }
+  }
+
+  @Before
+  public void setup() throws IOException {
+    // Turn off balancer
+    admin.setBalancerRunning(false, true);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    for (TableDescriptor td: UTIL.getAdmin().listTableDescriptors()) {
+      LOG.info("Tear down, remove table=" + td.getTableName());
+      UTIL.deleteTable(td.getTableName());
+    }
+    // Turn on balancer
+    admin.setBalancerRunning(true, false);
+  }
+
+  @Test(timeout = 120000)
+  public void testReportRSWithWrongRegion() throws Exception {
+    final TableName tableName = TableName.valueOf(this.name.getMethodName());
+
+    List<HRegionInfo> tableRegions = createTable(tableName);
+
+    final ServerName sn = ServerName.parseVersionedServerName(
+        ServerName.valueOf("1.example.org", 1, System.currentTimeMillis()).getVersionedBytes());
+
+    // make fake request with a region assigned to different RS
+    RegionServerStatusProtos.RegionServerReportRequest.Builder request =
+        makeRSReportRequestWithRegions(sn, tableRegions.get(1));
+
+    // sending fake request to master
+    // TODO: replace YouAreDeadException with appropriate exception as and when necessary
+    exception.expect(ServiceException.class);
+    exception.expectCause(isA(YouAreDeadException.class));
+    RegionServerStatusProtos.RegionServerReportResponse response =
+        master.getMasterRpcServices().regionServerReport(null, request.build());
+  }
+
+  private RegionServerStatusProtos.RegionServerReportRequest.Builder
+      makeRSReportRequestWithRegions(final ServerName sn, HRegionInfo... regions) {
+    ClusterStatusProtos.ServerLoad.Builder sl = ClusterStatusProtos.ServerLoad.newBuilder();
+    for (int i = 0; i < regions.length; i++) {
+      HBaseProtos.RegionSpecifier.Builder rs = HBaseProtos.RegionSpecifier.newBuilder();
+      rs.setType(HBaseProtos.RegionSpecifier.RegionSpecifierType.REGION_NAME);
+      rs.setValue(UnsafeByteOperations.unsafeWrap(regions[i].getRegionName()));
+
+      ClusterStatusProtos.RegionLoad.Builder rl = ClusterStatusProtos.RegionLoad.newBuilder()
+          .setRegionSpecifier(rs.build());
+
+      sl.addRegionLoads(i, rl.build());
+    }
+
+    return RegionServerStatusProtos.RegionServerReportRequest.newBuilder()
+              .setServer(ProtobufUtil.toServerName(sn))
+              .setLoad(sl);
+  }
+
+  private List<HRegionInfo> createTable(final TableName tableName) throws Exception {
+    TableDescriptorBuilder tdBuilder = TableDescriptorBuilder.newBuilder(tableName);
+    tdBuilder.addColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(FAMILY).build());
+
+    byte[][] rows = new byte[initialRegionCount - 1][];
+    for (int i = 0; i < rows.length; ++i) {
+      rows[i] = Bytes.toBytes(String.format("%d", i));
+    }
+    admin.createTable(tdBuilder.build(), rows);
+    return assertRegionCount(tableName, initialRegionCount);
+  }
+
+  private List<HRegionInfo> assertRegionCount(final TableName tableName, final int nregions)
+      throws Exception {
+    UTIL.waitUntilNoRegionsInTransition();
+    List<HRegionInfo> tableRegions = admin.getTableRegions(tableName);
+    assertEquals(nregions, tableRegions.size());
+    return tableRegions;
+  }
+}


[06/11] hbase git commit: Revert "HBASE-Fix client.TestClientClusterStatus (Chia-Ping Tsai)" Revert because missing JIRA number

Posted by bu...@apache.org.
Revert "HBASE-Fix client.TestClientClusterStatus (Chia-Ping Tsai)"
Revert because missing JIRA number

This reverts commit 7b3291fa8b836be9539817876799994fac5de335.


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

Branch: refs/heads/HBASE-18467
Commit: fbbae8774ca3162245c0d883c9f477f7d92bc8a5
Parents: 7b3291f
Author: Michael Stack <st...@apache.org>
Authored: Mon Aug 21 14:38:22 2017 -0700
Committer: Michael Stack <st...@apache.org>
Committed: Mon Aug 21 14:38:22 2017 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/client/TestClientClusterStatus.java      | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/fbbae877/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
index 484ee06..49b4ff2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientClusterStatus.java
@@ -65,7 +65,7 @@ public class TestClientClusterStatus {
     RegionServerThread rst = rsts.get(rsts.size() - 1);
     DEAD = rst.getRegionServer();
     DEAD.stop("Test dead servers status");
-    while (rst.isAlive()) {
+    while (!DEAD.isStopped()) {
       Thread.sleep(500);
     }
   }
@@ -155,11 +155,9 @@ public class TestClientClusterStatus {
     Assert.assertNotNull(status);
     Assert.assertNotNull(status.getServers());
     // exclude a dead region server
-    Assert.assertEquals(SLAVES -1, numRs);
-    // live servers = nums of regionservers
-    // By default, HMaster don't carry any regions so it won't report its load.
-    // Hence, it won't be in the server list.
-    Assert.assertEquals(status.getServers().size(), numRs);
+    Assert.assertEquals(SLAVES, numRs);
+    // live servers = primary master + nums of regionservers
+    Assert.assertEquals(status.getServers().size() + 1 /*Master*/, numRs);
     Assert.assertTrue(status.getRegionsCount() > 0);
     Assert.assertNotNull(status.getDeadServerNames());
     Assert.assertEquals(1, status.getDeadServersSize());

[10/11] hbase git commit: HBASE-18644 Duplicate compactionQueueLength metric in Region Server metrics

Posted by bu...@apache.org.
HBASE-18644 Duplicate compactionQueueLength metric in Region Server metrics

Signed-off-by: Andrew Purtell <ap...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/23ddf69c
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/23ddf69c
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/23ddf69c

Branch: refs/heads/HBASE-18467
Commit: 23ddf69c00a90673184f803ce4d76266ed0d45c5
Parents: 5895538
Author: Sukumar Maddineni <su...@gmail.com>
Authored: Mon Aug 21 16:54:42 2017 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Mon Aug 21 17:43:17 2017 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java   | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/23ddf69c/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java
----------------------------------------------------------------------
diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java
index e69e17c..77643ca 100644
--- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java
+++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java
@@ -398,8 +398,6 @@ public class MetricsRegionServerSourceImpl
             rsWrap.getSmallCompactionQueueSize())
           .addGauge(Interns.info(LARGE_COMPACTION_QUEUE_LENGTH, LARGE_COMPACTION_QUEUE_LENGTH_DESC),
             rsWrap.getLargeCompactionQueueSize())
-          .addGauge(Interns.info(COMPACTION_QUEUE_LENGTH, COMPACTION_QUEUE_LENGTH_DESC),
-            rsWrap.getCompactionQueueSize())
           .addGauge(Interns.info(FLUSH_QUEUE_LENGTH, FLUSH_QUEUE_LENGTH_DESC),
               rsWrap.getFlushQueueSize())