hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r591722 - in /lucene/hadoop/trunk/src/contrib/hbase: CHANGES.txt src/java/org/apache/hadoop/hbase/HMaster.java
Date Sun, 04 Nov 2007 01:47:25 GMT
Author: jimk
Date: Sat Nov  3 18:47:24 2007
New Revision: 591722

URL: http://svn.apache.org/viewvc?rev=591722&view=rev
Log:
HADOOP-2109 Fix another race condition in processing dead servers, Fix error online meta regions:
was using region name and not startKey as key for map.put

Modified:
    lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java

Modified: lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt?rev=591722&r1=591721&r2=591722&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt Sat Nov  3 18:47:24 2007
@@ -20,7 +20,9 @@
    HADOOP-2083 TestTableIndex failed in #970 and #956
    HADOOP-2109 Fixed race condition in processing server lease timeout.
    HADOOP-2137 hql.jsp : The character 0x19 is not valid
-   HADOOP-2109 Fix another race condition in processing dead servers
+   HADOOP-2109 Fix another race condition in processing dead servers,
+               Fix error online meta regions: was using region name and not
+               startKey as key for map.put
 
   IMPROVEMENTS
     HADOOP-2401 Add convenience put method that takes writable

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java?rev=591722&r1=591721&r2=591722&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java Sat
Nov  3 18:47:24 2007
@@ -1927,6 +1927,10 @@
           "meta and clearing pendingRegions");
 
           if (info.getTableDesc().getName().equals(META_TABLE_NAME)) {
+            if (LOG.isDebugEnabled()) {
+              LOG.debug("removing meta region " + info.getRegionName() +
+                  " from online meta regions");
+            }
             onlineMetaRegions.remove(info.getStartKey());
           }
 
@@ -2082,27 +2086,27 @@
         rootRescanned = true;
       }
 
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("numberOfMetaRegions: " + numberOfMetaRegions.get() +
+            ", onlineMetaRegions.size(): " + onlineMetaRegions.size());
+      }
+      if (numberOfMetaRegions.get() != onlineMetaRegions.size()) {
+        // We can't proceed because not all of the meta regions are online.
+        // We can't block either because that would prevent the meta region
+        // online message from being processed. So return false to have this
+        // operation requeued.
+        
+        if (LOG.isDebugEnabled()) {
+          LOG.debug(
+              "Requeuing shutdown because not all meta regions are online");
+        }
+        return false;
+      }
       for (int tries = 0; tries < numRetries; tries++) {
         try {
           if (closed.get()) {
             return true;
           }
-          if (!rootRescanned ||
-              numberOfMetaRegions.get() != onlineMetaRegions.size()) {
-            // We can't proceed because not all of the meta regions are online.
-            // We can't block either because that would prevent the meta region
-            // online message from being processed. So return false to have this
-            // operation requeued.
-            
-            if (LOG.isDebugEnabled()) {
-              LOG.debug("Requeuing shutdown because rootScanned: " +
-                  rootRescanned + ", numberOfMetaRegions: " +
-                  numberOfMetaRegions.get() + ", onlineMetaRegions.size(): " +
-                  onlineMetaRegions.size());
-            }
-            return false;
-          }
-
           for (MetaRegion r: onlineMetaRegions.values()) {
 
             HRegionInterface server = null;
@@ -2364,7 +2368,7 @@
           if (region.getTableDesc().getName().equals(META_TABLE_NAME)) {
             // It's a meta region.
             MetaRegion m = new MetaRegion(this.serverAddress,
-              this.region.getRegionName(), this.region.getRegionName());
+              this.region.getRegionName(), this.region.getStartKey());
             if (!initialMetaScanComplete) {
               // Put it on the queue to be scanned for the first time.
               try {
@@ -2377,7 +2381,7 @@
             } else {
               // Add it to the online meta regions
               LOG.debug("Adding to onlineMetaRegions: " + m.toString());
-              onlineMetaRegions.put(this.region.getRegionName(), m);
+              onlineMetaRegions.put(this.region.getStartKey(), m);
             }
           }
           // If updated successfully, remove from pending list.



Mime
View raw message