hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1495707 - /hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Date Sat, 22 Jun 2013 11:39:29 GMT
Author: ramkrishna
Date: Sat Jun 22 11:39:29 2013
New Revision: 1495707

URL: http://svn.apache.org/r1495707
Log:
HBASE-8705-RS holding META when restarted in a single node setup may hang infinitely without
META assignment (Ram)


Modified:
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1495707&r1=1495706&r2=1495707&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Sat Jun 22 11:39:29 2013
@@ -134,6 +134,12 @@ public class AssignmentManager extends Z
    * See below in {@link #assign()} and {@link #unassign()}.
    */
   private final int maximumAttempts;
+  
+  /**
+   * The sleep time for which the assignment will wait before retrying in case of META assignment
+   * failure due to lack of availability of region plan
+   */
+  private final long sleepTimeBeforeRetryingMetaAssignment;
 
   /** Plans for region movement. Key is the encoded version of a region name*/
   // TODO: When do plans get cleaned out?  Ever? In server open and in server
@@ -246,6 +252,8 @@ public class AssignmentManager extends Z
     this.zkTable = new ZKTable(this.watcher);
     this.maximumAttempts =
       this.server.getConfiguration().getInt("hbase.assignment.maximum.attempts", 10);
+    this.sleepTimeBeforeRetryingMetaAssignment = this.server.getConfiguration().getLong(
+        "hbase.meta.assignment.retry.sleeptime", 1000l);
     this.balancer = balancer;
     int maxThreads = conf.getInt("hbase.assignment.threads.max", 30);
     this.threadPoolExecutorService = Threads.getBoundedCachedThreadPool(
@@ -1769,6 +1777,19 @@ public class AssignmentManager extends Z
         if (tomActivated){
           this.timeoutMonitor.setAllRegionServersOffline(true);
         } else {
+          if (region.isMetaRegion()) {
+            try {
+              if (i != maximumAttempts) {
+                Thread.sleep(this.sleepTimeBeforeRetryingMetaAssignment);
+                continue;
+              }
+              // TODO : Ensure HBCK fixes this
+              LOG.error("Unable to determine a plan to assign META even after repeated attempts.
Run HBCK to fix this");
+            } catch (InterruptedException e) {
+              LOG.error("Got exception while waiting for META assignment");
+              Thread.currentThread().interrupt();
+            }
+          }
           regionStates.updateRegionState(region, RegionState.State.FAILED_OPEN);
         }
         return;



Mime
View raw message