Junegunn Choi created HBASE-29472:
-------------------------------------

             Summary: Fix splitting algorithms of RegionSplitter tool
                 Key: HBASE-29472
                 URL: https://issues.apache.org/jira/browse/HBASE-29472
             Project: HBase
          Issue Type: Bug
          Components: util
            Reporter: Junegunn Choi


h2. Summary

The two splitting algorithms of {{RegionSplitter}} tool, {{HexStringSplit}} and 
{{{}DecimalStringSplit{}}}, compute an incorrect split point for the last 
region of a table because it fail to treat the "max" key as inclusive.
h2. Before the fix
h3. HexStringSplit
{code:java}
Table testSplitPresplitTableHex has 8 regions that will be split.
Will Split [00000000 , 20000000) at 10000000
Will Split [20000000 , 40000000) at 30000000
Will Split [40000000 , 60000000) at 50000000
Will Split [60000000 , 80000000) at 70000000
Will Split [80000000 , a0000000) at 90000000
Will Split [a0000000 , c0000000) at b0000000
Will Split [c0000000 , e0000000) at d0000000
Will Split [e0000000 , ffffffff) at efffffff <- Incorrect split point
{code}
h3. DecimalStringSplit
{code:java}
Table testSplitPresplitTableDecimal has 8 regions that will be split.
Will Split [00000000 , 12500000) at 06250000
Will Split [12500000 , 25000000) at 18750000
Will Split [25000000 , 37500000) at 31250000
Will Split [37500000 , 50000000) at 43750000
Will Split [50000000 , 62500000) at 56250000
Will Split [62500000 , 75000000) at 68750000
Will Split [75000000 , 87500000) at 81250000
Will Split [87500000 , 99999999) at 93749999 <- Incorrect split point
{code}
h2. After the fix
h3. HexStringSplit
{code:java}
Table testSplitPresplitTableHex has 8 regions that will be split.
Will Split [00000000 , 20000000) at 10000000
Will Split [20000000 , 40000000) at 30000000
Will Split [40000000 , 60000000) at 50000000
Will Split [60000000 , 80000000) at 70000000
Will Split [80000000 , a0000000) at 90000000
Will Split [a0000000 , c0000000) at b0000000
Will Split [c0000000 , e0000000) at d0000000
Will Split [e0000000 , ffffffff) at f0000000
{code}
h3. DecimalStringSplit
{code:java}
Table testSplitPresplitTableDecimal has 8 regions that will be split.
Will Split [00000000 , 12500000) at 06250000
Will Split [12500000 , 25000000) at 18750000
Will Split [25000000 , 37500000) at 31250000
Will Split [37500000 , 50000000) at 43750000
Will Split [50000000 , 62500000) at 56250000
Will Split [62500000 , 75000000) at 68750000
Will Split [75000000 , 87500000) at 81250000
Will Split [87500000 , 99999999) at 93750000
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to