hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r810597 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/master/RegionManager.java
Date Wed, 02 Sep 2009 16:38:04 GMT
Author: stack
Date: Wed Sep  2 16:38:03 2009
New Revision: 810597

URL: http://svn.apache.org/viewvc?rev=810597&view=rev
Log:
HBASE-1810 ConcurrentModificationException in region assignment

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=810597&r1=810596&r2=810597&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Wed Sep  2 16:38:03 2009
@@ -363,6 +363,8 @@
    HBASE-1780  HTable.flushCommits clears write buffer in finally clause
    HBASE-1784  Missing rows after medium intensity insert
    HBASE-1809  NPE thrown in BoundedRangeFileInputStream
+   HBASE-1810  ConcurrentModificationException in region assignment
+               (Mathias Herberts via Stack)
 
   IMPROVEMENTS
    HBASE-1089  Add count of regions on filesystem to master UI; add percentage

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=810597&r1=810596&r2=810597&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java Wed Sep
 2 16:38:03 2009
@@ -425,20 +425,22 @@
       return regionsToAssign; // dont assign anything to this server.
     }
 
-    for (RegionState s: regionsInTransition.values()) {
-      HRegionInfo i = s.getRegionInfo();
-      if (i == null) {
-        continue;
-      }
-      if (reassigningMetas &&
-          !i.isMetaRegion()) {
-        // Can't assign user regions until all meta regions have been assigned
-        // and are on-line
-        continue;
-      }
-      if (s.isUnassigned()) {
-        regionsToAssign.add(s);
-      }
+    synchronized(regionsInTransition) {
+      for (RegionState s: regionsInTransition.values()) {
+        HRegionInfo i = s.getRegionInfo();
+        if (i == null) {
+          continue;
+        }
+        if (reassigningMetas &&
+            !i.isMetaRegion()) {
+          // Can't assign user regions until all meta regions have been assigned
+          // and are on-line
+          continue;
+        }
+        if (s.isUnassigned()) {
+          regionsToAssign.add(s);
+        }
+      }      
     }
     return regionsToAssign;
   }
@@ -834,14 +836,16 @@
 
     // This might be expensive, but we need to make sure we dont
     // get double assignment to the same regionserver.
-    for (RegionState s : regionsInTransition.values()) {
-      if (s.getRegionInfo().isMetaRegion()
-          && !s.isUnassigned()
-          && s.getServerName() != null
-          && s.getServerName().equals(server.toString())) {
-        // Has an outstanding meta region to be assigned.
-        return true;
-      }
+    synchronized(regionsInTransition) {
+      for (RegionState s : regionsInTransition.values()) {
+        if (s.getRegionInfo().isMetaRegion()
+            && !s.isUnassigned()
+            && s.getServerName() != null
+            && s.getServerName().equals(server.toString())) {
+          // Has an outstanding meta region to be assigned.
+          return true;
+        }
+      }      
     }
     return false;
   }



Mime
View raw message