HBASE-6089 SSH and AM.joinCluster causes Concurrent Modification exception. (Rajesh)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1344816 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ramkrishna 2012-05-31 17:05:59 +00:00
parent ff2bcd4760
commit f05b600cf4
3 changed files with 17 additions and 20 deletions

View File

@ -358,7 +358,6 @@ public class AssignmentManager extends ZooKeeperListener {
/** /**
* Called on startup. * Called on startup.
* Figures whether a fresh cluster start of we are joining extant running cluster. * Figures whether a fresh cluster start of we are joining extant running cluster.
* @param onlineServers onlined servers when master started
* @throws IOException * @throws IOException
* @throws KeeperException * @throws KeeperException
* @throws InterruptedException * @throws InterruptedException
@ -426,6 +425,7 @@ public class AssignmentManager extends ZooKeeperListener {
// Run through all regions. If they are not assigned and not in RIT, then // Run through all regions. If they are not assigned and not in RIT, then
// its a clean cluster startup, else its a failover. // its a clean cluster startup, else its a failover.
synchronized (this.regions) {
for (Map.Entry<HRegionInfo, ServerName> e: this.regions.entrySet()) { for (Map.Entry<HRegionInfo, ServerName> e: this.regions.entrySet()) {
if (!e.getKey().isMetaTable() && e.getValue() != null) { if (!e.getKey().isMetaTable() && e.getValue() != null) {
LOG.debug("Found " + e + " out on cluster"); LOG.debug("Found " + e + " out on cluster");
@ -439,6 +439,7 @@ public class AssignmentManager extends ZooKeeperListener {
break; break;
} }
} }
}
// Remove regions in RIT, they are possibly being processed by // Remove regions in RIT, they are possibly being processed by
// ServerShutdownHandler. // ServerShutdownHandler.
@ -2547,8 +2548,6 @@ public class AssignmentManager extends ZooKeeperListener {
* <p> * <p>
* Returns a map of servers that are not found to be online and the regions * Returns a map of servers that are not found to be online and the regions
* they were hosting. * they were hosting.
* @param onlineServers if one region's location belongs to onlineServers, it
* doesn't need to be assigned.
* @return map of servers not online to their assigned regions, as stored * @return map of servers not online to their assigned regions, as stored
* in META * in META
* @throws IOException * @throws IOException
@ -2624,9 +2623,11 @@ public class AssignmentManager extends ZooKeeperListener {
// add only if region not in disabled and enabling table // add only if region not in disabled and enabling table
if (false == checkIfRegionBelongsToDisabled(regionInfo) if (false == checkIfRegionBelongsToDisabled(regionInfo)
&& false == checkIfRegionsBelongsToEnabling(regionInfo)) { && false == checkIfRegionsBelongsToEnabling(regionInfo)) {
synchronized (this.regions) {
regions.put(regionInfo, regionLocation); regions.put(regionInfo, regionLocation);
addToServers(regionLocation, regionInfo); addToServers(regionLocation, regionInfo);
} }
}
disablingOrEnabling = addTheTablesInPartialState(this.disablingTables, disablingOrEnabling = addTheTablesInPartialState(this.disablingTables,
this.enablingTables, regionInfo, tableName); this.enablingTables, regionInfo, tableName);
disabled = checkIfRegionBelongsToDisabled(regionInfo); disabled = checkIfRegionBelongsToDisabled(regionInfo);
@ -3366,7 +3367,6 @@ public class AssignmentManager extends ZooKeeperListener {
* Run through remaining regionservers and unassign all catalog regions. * Run through remaining regionservers and unassign all catalog regions.
*/ */
void unassignCatalogRegions() { void unassignCatalogRegions() {
this.servers.entrySet();
synchronized (this.regions) { synchronized (this.regions) {
for (Map.Entry<ServerName, Set<HRegionInfo>> e: this.servers.entrySet()) { for (Map.Entry<ServerName, Set<HRegionInfo>> e: this.servers.entrySet()) {
Set<HRegionInfo> regions = e.getValue(); Set<HRegionInfo> regions = e.getValue();

View File

@ -663,7 +663,6 @@ Server {
/** /**
* Override to change master's splitLogAfterStartup. Used testing * Override to change master's splitLogAfterStartup. Used testing
* @param mfs * @param mfs
* @param onlineServers
*/ */
protected void splitLogAfterStartup(final MasterFileSystem mfs) { protected void splitLogAfterStartup(final MasterFileSystem mfs) {
mfs.splitLogAfterStartup(); mfs.splitLogAfterStartup();

View File

@ -187,8 +187,6 @@ public class MasterFileSystem {
/** /**
* Inspect the log directory to recover any log file without * Inspect the log directory to recover any log file without
* an active region server. * an active region server.
* @param onlineServers Set of online servers keyed by
* {@link ServerName}
*/ */
void splitLogAfterStartup() { void splitLogAfterStartup() {
boolean retrySplitting = !conf.getBoolean("hbase.hlog.split.skip.errors", boolean retrySplitting = !conf.getBoolean("hbase.hlog.split.skip.errors",