diff --git a/CHANGES.txt b/CHANGES.txt index b057b966b1a..8c228246b08 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -363,6 +363,8 @@ Release 0.20.0 - Unreleased 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 diff --git a/src/java/org/apache/hadoop/hbase/master/RegionManager.java b/src/java/org/apache/hadoop/hbase/master/RegionManager.java index aee7c88796b..ddad8d092b7 100644 --- a/src/java/org/apache/hadoop/hbase/master/RegionManager.java +++ b/src/java/org/apache/hadoop/hbase/master/RegionManager.java @@ -425,20 +425,22 @@ class RegionManager implements HConstants { 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 @@ class RegionManager implements HConstants { // 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; }