hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r822803 - in /hadoop/hbase/branches/0.20: ./ src/java/org/apache/hadoop/hbase/master/ src/java/org/apache/hadoop/hbase/regionserver/
Date Wed, 07 Oct 2009 16:56:03 GMT
Author: stack
Date: Wed Oct  7 16:56:02 2009
New Revision: 822803

URL: http://svn.apache.org/viewvc?rev=822803&view=rev
Log:
HBASE-1890 hbase-1506 where assignment is done at regionserver doesn't work

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ServerManager.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=822803&r1=822802&r2=822803&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Wed Oct  7 16:56:02 2009
@@ -46,6 +46,7 @@
                hbase-1784)
    HBASE-1831  Scanning API must be reworked to allow for fully functional
                Filters client-side
+   HBASE-1890  hbase-1506 where assignment is done at regionserver doesn't work
 
   IMPROVEMENTS
    HBASE-1819  Update to 0.20.1 hadoop and zk 3.2.1

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=822803&r1=822802&r2=822803&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
Wed Oct  7 16:56:02 2009
@@ -341,17 +341,8 @@
     LOG.info("Assigning region " + regionName + " to " + sinfo.getServerName());
     rs.setPendingOpen(sinfo.getServerName());
     this.regionsInTransition.put(regionName, rs);
-    if (returnMsgs != null) {
-      returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_OPEN, rs.getRegionInfo()));
-    }
-  }
 
-  /**
-   * @param regionName
-   * @param sinfo
-   */
-  void doRegionAssignment(final String regionName, final HServerInfo sinfo) {
-    doRegionAssignment(this.regionsInTransition.get(regionName), sinfo, null);
+    returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_OPEN, rs.getRegionInfo()));
   }
 
   /*

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ServerManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ServerManager.java?rev=822803&r1=822802&r2=822803&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ServerManager.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ServerManager.java
Wed Oct  7 16:56:02 2009
@@ -454,8 +454,7 @@
           break;
 
         case MSG_REPORT_SPLIT:
-          processSplitRegion(serverInfo, region, incomingMsgs[++i],
-            incomingMsgs[++i]);
+          processSplitRegion(region, incomingMsgs[++i], incomingMsgs[++i]);
           break;
 
         default:
@@ -497,26 +496,18 @@
    * @param splitB
    * @param returnMsgs
    */
-  private void processSplitRegion(final HServerInfo si, final HRegionInfo region,
-      final HMsg splitA, final HMsg splitB) {
+  private void processSplitRegion(HRegionInfo region, HMsg splitA, HMsg splitB) {
     synchronized (master.regionManager) {
       // Cancel any actions pending for the affected region.
       // This prevents the master from sending a SPLIT message if the table
       // has already split by the region server. 
-      this.master.regionManager.endActions(region.getRegionName());
-      // Region A is now opened immediately on the splitting server.  The message
-      // that its been successfully opened is probably just behind this split
-      // message.  Set up the master state so that its properly primed for the
-      // coming open message.
-      HRegionInfo a = splitA.getRegionInfo();
-      assignSplitDaughter(a);
-      this.master.regionManager.doRegionAssignment(a.getRegionNameAsString(), si);
-      // Region B will be assigned old-school style by the master.
+      master.regionManager.endActions(region.getRegionName());
+      assignSplitDaughter(splitA.getRegionInfo());
       assignSplitDaughter(splitB.getRegionInfo());
       if (region.isMetaTable()) {
         // A meta region has split.
-        this.master.regionManager.offlineMetaRegion(region.getStartKey());
-        this.master.regionManager.incrementNumMetaRegions();
+        master.regionManager.offlineMetaRegion(region.getStartKey());
+        master.regionManager.incrementNumMetaRegions();
       }
     }
   }
@@ -587,7 +578,7 @@
       if (duplicateAssignment) {
         if (LOG.isDebugEnabled()) {
           LOG.debug("region server " + serverInfo.getServerAddress().toString()
-            + " should not have opened region " + Bytes.toString(region.getRegionName()));
+              + " should not have opened region " + Bytes.toString(region.getRegionName()));
         }
 
         // This Region should not have been opened.

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java?rev=822803&r1=822802&r2=822803&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
Wed Oct  7 16:56:02 2009
@@ -30,13 +30,10 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HMsg;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.RemoteExceptionHandler;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
-import org.apache.hadoop.hbase.regionserver.HRegionServer.ToDoEntry;
-import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Writables;
 import org.apache.hadoop.util.StringUtils;
 
@@ -220,8 +217,8 @@
         newRegions[i].getRegionInfo()));
       t.put(put);
     }
-    // Now tell the master about the new regions.  Note that we'll online 
-    // the A region ourselves on this server.  Master only has to online B.
+        
+    // Now tell the master about the new regions
     server.reportSplit(oldRegionInfo, newRegions[0].getRegionInfo(),
       newRegions[1].getRegionInfo());
     LOG.info("region split, META updated, and report to master all" +
@@ -229,15 +226,8 @@
       ", new regions: " + newRegions[0].toString() + ", " +
       newRegions[1].toString() + ". Split took " +
       StringUtils.formatTimeDiff(System.currentTimeMillis(), startTime));
-    // Server region A.  Let master assign region B.
-    HRegionInfo hri = newRegions[0].getRegionInfo();
-    HMsg msg = new HMsg(HMsg.Type.MSG_REGION_OPEN, hri,
-      Bytes.toBytes("Local immediate open"));
-    try {
-      this.server.toDo.put(new HRegionServer.ToDoEntry(msg));
-    } catch (InterruptedException e) {
-      throw new IOException("Failed queue of open of " + hri, e);
-    }
+    
+    // Do not serve the new regions. Let the Master assign them.
   }
 
   /**

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=822803&r1=822802&r2=822803&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Wed Oct  7 16:56:02 2009
@@ -1452,7 +1452,7 @@
   /*
    * Data structure to hold a HMsg and retries count.
    */
-  static final class ToDoEntry {
+  private static final class ToDoEntry {
     protected final AtomicInteger tries = new AtomicInteger(0);
     protected final HMsg msg;
 



Mime
View raw message