[
https://issues.apache.org/jira/browse/HBASE-5848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13259411#comment-13259411
]
ramkrishna.s.vasudevan commented on HBASE-5848:
-----------------------------------------------
@Lars
I have analysed this problem.
First thing is if we pass an empty byte array it is trying to form two regions
with empty start and end keys.
But the reason for it to abort is when it tries to form the two regions it so
happens that the region id generated from the System.currenttimeInMillis
becomes same and it tries to create the same node twice. And hence we get that
aborting from the asyncSetOfflineInZooKeeper
{code}
CreateUnassignedAsyncCallback cb =
new CreateUnassignedAsyncCallback(this.watcher, destination, counter);
for (RegionState state: states) {
if (!asyncSetOfflineInZooKeeper(state, cb, state)) {
return;
}
}
{code}
The region Id is formed from
{code}
public HRegionInfo(final byte[] tableName, final byte[] startKey,
final byte[] endKey, final boolean split)
throws IllegalArgumentException {
this(tableName, startKey, endKey, split, System.currentTimeMillis());
}
{code}
So there is always a chance that we get same region id but just because the
start key and end key changes we were not encountering this problem.
I suggest we add a logic explicitly to avoid 2 regions from getting formed and
also the main thing is can we take System.nanoTime for the region id.?
Even i was not able to get this repeatedly in testcases but a real cluster
gives you the problem.
> Create table with EMPTY_START_ROW passed as splitKey causes the HMaster to
> abort
> --------------------------------------------------------------------------------
>
> Key: HBASE-5848
> URL: https://issues.apache.org/jira/browse/HBASE-5848
> Project: HBase
> Issue Type: Bug
> Components: client
> Reporter: Lars Hofhansl
> Assignee: Lars Hofhansl
> Priority: Minor
>
> A coworker of mine just had this scenario. It does not make sense the
> EMPTY_START_ROW as splitKey (since the region with the empty start key is
> implicit), but it should not cause the HMaster to abort.
> The abort happens because it tries to bulk assign the same region twice and
> then runs into race conditions with ZK.
> The same would (presumably) happen when two identical split keys are passed,
> but the client blocks that. The simplest solution here is to also block
> passed null or EMPTY_START_ROW as split key by the client.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira