HBASE-13076 Table can be forcibly enabled in AssignmentManager during table disabling (Andrey Stepachev)

This commit is contained in:
stack 2015-03-05 11:47:02 -08:00
parent c15e684bf9
commit 4570451f7c

View File

@ -1008,18 +1008,6 @@ public class AssignmentManager {
regionStates.updateRegionState(region, State.FAILED_OPEN);
return;
}
// 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 hbase: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.
TableName tableName = region.getTable();
if (!tableStateManager.isTableState(tableName,
TableState.State.ENABLED, TableState.State.ENABLING)) {
LOG.debug("Setting table " + tableName + " to ENABLED state.");
setEnabledTable(tableName);
}
LOG.info("Assigning " + region.getRegionNameAsString() +
" to " + plan.getDestination().toString());
// Transition RegionState to PENDING_OPEN