HBASE-1810 ConcurrentModificationException in region assignment

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@810597 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-09-02 16:38:03 +00:00
parent 9c1869648c
commit ea3b8028c9
2 changed files with 28 additions and 22 deletions

View File

@ -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

View File

@ -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;
}