You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2016/10/12 15:56:20 UTC

[jira] [Comment Edited] (HBASE-16816) HMaster.move() should throw exception if region to move is not online

    [ https://issues.apache.org/jira/browse/HBASE-16816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15568918#comment-15568918 ] 

Ted Yu edited comment on HBASE-16816 at 10/12/16 3:55 PM:
----------------------------------------------------------

lgtm
But please fix the test failure:
{code}
testWarmup(org.apache.hadoop.hbase.master.TestWarmupRegion)  Time elapsed: 27.807 sec  <<< ERROR!
org.apache.hadoop.hbase.HBaseIOException: moving region not onlined: {ENCODED => 13a22f614f3695013ff1122c368f472b, NAME => 'testPurgeFutureDeletes,,1476277547372.13a22f614f3695013ff1122c368f472b.', STARTKEY => '', ENDKEY => ''}, {13a22f614f3695013ff1122c368f472b state=PENDING_CLOSE, ts=1476277575080, server=1235fe86b25b,37579,1476277542544}
	at org.apache.hadoop.hbase.master.HMaster.move(HMaster.java:1506)
	at org.apache.hadoop.hbase.master.TestWarmupRegion.testWarmup(TestWarmupRegion.java:159)
{code}


was (Author: yuzhihong@gmail.com):
lgtm
You may want to let QA rerun the patch.

> HMaster.move() should throw exception if region to move is not online
> ---------------------------------------------------------------------
>
>                 Key: HBASE-16816
>                 URL: https://issues.apache.org/jira/browse/HBASE-16816
>             Project: HBase
>          Issue Type: Bug
>          Components: Admin
>    Affects Versions: 1.1.2
>            Reporter: Allan Yang
>            Assignee: Allan Yang
>            Priority: Minor
>         Attachments: HBASE-16816-branch-1.patch
>
>
> The move region function in HMaster only checks whether the region to move exists
> {code}
> if (regionState == null) {
>       throw new UnknownRegionException(Bytes.toStringBinary(encodedRegionName));
>     }
> {code}
> It will not return anything if the region is split or in transition which is not movable. So the caller has no way to know if the move region operation is failed.
> It is a problem for "region_move.rb". It only gives up moving a region if a exception is thrown.Otherwise, it will wait until a timeout and retry. Without a exception, it have no idea the region is not movable.
> {code}
> begin
>       admin.move(Bytes.toBytes(r.getEncodedName()), Bytes.toBytes(newServer))
>     rescue java.lang.reflect.UndeclaredThrowableException,
>         org.apache.hadoop.hbase.UnknownRegionException => e
>       $LOG.info("Exception moving "  + r.getEncodedName() +
>         "; split/moved? Continuing: " + e)
>       return
>     end
>  # Wait till its up on new server before moving on
>     maxWaitInSeconds = admin.getConfiguration.getInt("hbase.move.wait.max", 60)
>     maxWait = Time.now + maxWaitInSeconds
>     while Time.now < maxWait
>       same = isSameServer(admin, r, original)
>       break unless same
>       sleep 0.1
>     end
>   end
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)