HBASE-4265 zookeeper.KeeperException$NodeExistsException if HMaster restarts
while table is being disabled (Ming Ma) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1164803 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
236709bcb1
commit
f2552ba5fd
|
@ -237,6 +237,8 @@ Release 0.91.0 - Unreleased
|
||||||
HMaster restarts (Ming Ma)
|
HMaster restarts (Ming Ma)
|
||||||
HBASE-4310 SlabCache metrics bugfix (Li Pi)
|
HBASE-4310 SlabCache metrics bugfix (Li Pi)
|
||||||
HBASE-4027 Off Heap Cache never creates Slabs (Li Pi)
|
HBASE-4027 Off Heap Cache never creates Slabs (Li Pi)
|
||||||
|
HBASE-4265 zookeeper.KeeperException$NodeExistsException if HMaster restarts
|
||||||
|
while table is being disabled (Ming Ma)
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
|
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
|
||||||
|
|
|
@ -132,6 +132,11 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
|
|
||||||
private final ZKTable zkTable;
|
private final ZKTable zkTable;
|
||||||
|
|
||||||
|
// store all the table names in disabling state
|
||||||
|
Set<String> disablingTables = new HashSet<String>(1);
|
||||||
|
// store all the enabling state tablenames.
|
||||||
|
Set<String> enablingTables = new HashSet<String>(1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Server to regions assignment map.
|
* Server to regions assignment map.
|
||||||
* Contains the set of regions currently assigned to a given server.
|
* Contains the set of regions currently assigned to a given server.
|
||||||
|
@ -307,6 +312,11 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
processDeadServers(deadServers);
|
processDeadServers(deadServers);
|
||||||
// Check existing regions in transition
|
// Check existing regions in transition
|
||||||
processRegionsInTransition(deadServers);
|
processRegionsInTransition(deadServers);
|
||||||
|
|
||||||
|
// Recover the tables that were not fully moved to DISABLED state.
|
||||||
|
// These tables are in DISABLING state when the master restarted/switched.
|
||||||
|
boolean isWatcherCreated = recoverTableInDisablingState(this.disablingTables);
|
||||||
|
recoverTableInEnablingState(this.enablingTables, isWatcherCreated);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1929,10 +1939,6 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
// Map of offline servers and their regions to be returned
|
// Map of offline servers and their regions to be returned
|
||||||
Map<ServerName, List<Pair<HRegionInfo,Result>>> offlineServers =
|
Map<ServerName, List<Pair<HRegionInfo,Result>>> offlineServers =
|
||||||
new TreeMap<ServerName, List<Pair<HRegionInfo, Result>>>();
|
new TreeMap<ServerName, List<Pair<HRegionInfo, Result>>>();
|
||||||
// store all the table names in disabling state
|
|
||||||
Set<String> disablingTables = new HashSet<String>(1);
|
|
||||||
// store all the enabling state tablenames.
|
|
||||||
Set<String> enablingTables = new HashSet<String>(1);
|
|
||||||
// Iterate regions in META
|
// Iterate regions in META
|
||||||
for (Result result : results) {
|
for (Result result : results) {
|
||||||
Pair<HRegionInfo, ServerName> region = MetaReader.metaRowToRegionPair(result);
|
Pair<HRegionInfo, ServerName> region = MetaReader.metaRowToRegionPair(result);
|
||||||
|
@ -1956,7 +1962,7 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
" has null regionLocation." + " But its table " + tableName +
|
" has null regionLocation." + " But its table " + tableName +
|
||||||
" isn't in ENABLING state.");
|
" isn't in ENABLING state.");
|
||||||
}
|
}
|
||||||
addTheTablesInPartialState(disablingTables, enablingTables, regionInfo,
|
addTheTablesInPartialState(this.disablingTables, this.enablingTables, regionInfo,
|
||||||
tableName);
|
tableName);
|
||||||
} else if (!this.serverManager.isServerOnline(regionLocation)) {
|
} else if (!this.serverManager.isServerOnline(regionLocation)) {
|
||||||
// Region is located on a server that isn't online
|
// Region is located on a server that isn't online
|
||||||
|
@ -1975,17 +1981,13 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
regions.put(regionInfo, regionLocation);
|
regions.put(regionInfo, regionLocation);
|
||||||
addToServers(regionLocation, regionInfo);
|
addToServers(regionLocation, regionInfo);
|
||||||
}
|
}
|
||||||
addTheTablesInPartialState(disablingTables, enablingTables, regionInfo,
|
addTheTablesInPartialState(this.disablingTables, this.enablingTables, regionInfo,
|
||||||
tableName);
|
tableName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Recover the tables that were not fully moved to DISABLED state.
|
|
||||||
// These tables are in DISABLING state when the master restarted/switched.
|
|
||||||
boolean isWatcherCreated = recoverTableInDisablingState(disablingTables);
|
|
||||||
recoverTableInEnablingState(enablingTables, isWatcherCreated);
|
|
||||||
return offlineServers;
|
return offlineServers;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addTheTablesInPartialState(Set<String> disablingTables,
|
private void addTheTablesInPartialState(Set<String> disablingTables,
|
||||||
Set<String> enablingTables, HRegionInfo regionInfo,
|
Set<String> enablingTables, HRegionInfo regionInfo,
|
||||||
String disablingTableName) {
|
String disablingTableName) {
|
||||||
|
|
Loading…
Reference in New Issue