Pankaj Kumar created HBASE-20771:
------------------------------------
Summary: PUT operation fail with "No server address listed in
hbase:meta for region xxxxx"
Key: HBASE-20771
URL: https://issues.apache.org/jira/browse/HBASE-20771
Project: HBase
Issue Type: Bug
Components: Client
Affects Versions: 1.5.0
Reporter: Pankaj Kumar
Assignee: Pankaj Kumar
1) Create a table with 1 region
2) AM send RPC to RS to open the region,
{code}
// invoke assignment (async)
ArrayList<HRegionInfo> userRegionSet = new ArrayList<HRegionInfo>(regions);
for (Map.Entry<ServerName, List<HRegionInfo>> plan: bulkPlan.entrySet()) {
if (!assign(plan.getKey(), plan.getValue())) {
for (HRegionInfo region: plan.getValue()) {
if (!regionStates.isRegionOnline(region)) {
invokeAssign(region);
if (!region.getTable().isSystemTable()) {
userRegionSet.add(region);
}
}
}
}
}
{code}
In above code if assignment fails (due to some problem) then AM will sumbit the
assign request to the thread pool and wait for some duration (here it will wait
for 20sec, region count is 1).
3) After 20sec, CreateTableProcedure will set table state as ENABLED in ZK and
finish the procedure.
{code}
// Mark the table as Enabling
assignmentManager.getTableStateManager().setTableState(tableName,
ZooKeeperProtos.Table.State.ENABLING);
// Trigger immediate assignment of the regions in round-robin fashion
ModifyRegionUtils.assignRegions(assignmentManager, regions);
// Enable table
assignmentManager.getTableStateManager()
.setTableState(tableName, ZooKeeperProtos.Table.State.ENABLED);
{code}
4) At the client side, CreateTableFuture.waitProcedureResult(...) is waiting
for the procedure to finish,
{code}
// If the procedure is no longer running, we should have a result
if (response != null && response.getState() !=
GetProcedureResultResponse.State.RUNNING) {
procResultFound = response.getState() !=
GetProcedureResultResponse.State.NOT_FOUND;
return convertResult(response);
}
{code}
Here we wait for operation result only when procedure result not found, but in
this scenario it will be wrong because region assignment didnt complete,
{code}
// if we don't have a proc result, try the compatibility wait
if (!procResultFound) {
result = waitOperationResult(deadlineTs);
}
{code}
Since HBaseAdmin didn't wait for operation result (successful region
assignment), so client PUT operation will fail by the time region is
successfully opened because "info:server" entry wont be there in meta.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)