HBASE-6229 AM.assign() should not set table state to ENABLED directly (Rajesh)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1352262 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
621ec576eb
commit
145c4d2583
|
@ -1714,7 +1714,17 @@ public class AssignmentManager extends ZooKeeperListener {
|
|||
if (isDisabledorDisablingRegionInRIT(region)) {
|
||||
return;
|
||||
}
|
||||
setEnabledTable(region);
|
||||
// In case of assignment from EnableTableHandler table state is ENABLING. Any how
|
||||
// EnableTableHandler will set ENABLED after assigning all the table regions. If we
|
||||
// try to set to ENABLED directly then client api may think table is enabled.
|
||||
// When we have a case such as all the regions are added directly into .META. and we call
|
||||
// assignRegion then we need to make the table ENABLED. Hence in such case the table
|
||||
// will not be in ENABLING or ENABLED state.
|
||||
String tableName = region.getTableNameAsString();
|
||||
if (!zkTable.isEnablingTable(tableName) && !zkTable.isEnabledTable(tableName)) {
|
||||
LOG.debug("Setting table " + tableName + " to ENABLED state.");
|
||||
setEnabledTable(region);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (setOfflineInZK && versionOfOfflineNode == -1) {
|
||||
|
|
Loading…
Reference in New Issue