Index: src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (revision 1343470) +++ src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (working copy) @@ -392,19 +392,20 @@ watcher.assignmentZNode); // Run through all regions. If they are not assigned and not in RIT, then // its a clean cluster startup, else its a failover. - for (Map.Entry e: this.regions.entrySet()) { - if (!e.getKey().isMetaTable() - && e.getValue() != null) { - LOG.debug("Found " + e + " out on cluster"); - this.failover = true; - break; + synchronized (this.regions) { + for (Map.Entry e : this.regions.entrySet()) { + if (!e.getKey().isMetaTable() && e.getValue() != null) { + LOG.debug("Found " + e + " out on cluster"); + this.failover = true; + break; + } + if (nodes.contains(e.getKey().getEncodedName())) { + LOG.debug("Found " + e.getKey().getRegionNameAsString() + " in RITs"); + // Could be a meta region. + this.failover = true; + break; + } } - if (nodes.contains(e.getKey().getEncodedName())) { - LOG.debug("Found " + e.getKey().getRegionNameAsString() + " in RITs"); - // Could be a meta region. - this.failover = true; - break; - } } // Remove regions in RIT, they are possibly being processed by @@ -2422,8 +2423,10 @@ // add only if region not in disabled and enabling table if (false == checkIfRegionBelongsToDisabled(regionInfo) && false == checkIfRegionsBelongsToEnabling(regionInfo)) { - regions.put(regionInfo, regionLocation); - addToServers(regionLocation, regionInfo); + synchronized (this.regions) { + regions.put(regionInfo, regionLocation); + addToServers(regionLocation, regionInfo); + } } addTheTablesInPartialState(this.disablingTables, this.enablingTables, regionInfo, tableName); @@ -3031,7 +3034,6 @@ * Run through remaining regionservers and unassign all catalog regions. */ void unassignCatalogRegions() { - this.servers.entrySet(); synchronized (this.regions) { for (Map.Entry> e: this.servers.entrySet()) { Set regions = e.getValue();