hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-3315) Add debug output for when balancer makes bad balance
Date Tue, 07 Dec 2010 00:58:09 GMT

    [ https://issues.apache.org/jira/browse/HBASE-3315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12968524#action_12968524
] 

stack commented on HBASE-3315:
------------------------------

Here is what I'm committing..... (after testing on cluster).
{code}
===================================================================
--- src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java      (revision 1042857)
+++ src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java      (working copy)
@@ -293,11 +293,20 @@

     long endTime = System.currentTimeMillis();

-    assert(regionidx == regionsToMove.size()): "clusterState=" + clusterState +
-      ", regionidx=" + regionidx + ", regionsToMove=" + regionsToMove +
+    if (regionidx != regionsToMove.size() || neededRegions != 0) {
+      // Emit data so can diagnose how balancer went astray.
+      LOG.warn("regionidx=" + regionidx + ", regionsToMove=" + regionsToMove.size() +
       ", numServers=" + numServers + ", serversOverloaded=" + serversOverloaded +
-      ", serversUnderloaded=" + serversUnderloaded;
-    assert(neededRegions == 0);
+      ", serversUnderloaded=" + serversUnderloaded);
+      StringBuilder sb = new StringBuilder();
+      for (Map.Entry<HServerInfo, List<HRegionInfo>> e: clusterState.entrySet())
{
+        if (sb.length() > 0) sb.append(", ");
+        sb.append(e.getKey().getServerName());
+        sb.append(" ");
+        sb.append(e.getValue().size());
+      }
+      LOG.warn("Input " + sb.toString());
+    }

     // All done!
     LOG.info("Calculated a load balance in " + (endTime-startTime) + "ms. " +
@@ -636,7 +645,7 @@
     public String toString() {
       return "hri=" + this.hri.getRegionNameAsString() + ", src=" +
         (this.source == null? "": this.source.getServerName()) +
-        ", dest=" + this.dest.getServerName();
+        ", dest=" + (this.dest == null? "": this.dest.getServerName());
     }
   }
 }
{code}

> Add debug output for when balancer makes bad balance
> ----------------------------------------------------
>
>                 Key: HBASE-3315
>                 URL: https://issues.apache.org/jira/browse/HBASE-3315
>             Project: HBase
>          Issue Type: Bug
>            Reporter: stack
>             Fix For: 0.90.0
>
>
> Balancer had assertions at end of the balanceCluster method.  These assertions trigger
on occasion -- just did for me and did previously for j-d -- only there's no data to analyze
when it fails.  Add logging data on balancer input and summary.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message