hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ShiXing (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-6520) MSLab May cause the Bytes.toLong does not work correctly for increment
Date Tue, 07 Aug 2012 16:48:10 GMT

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

ShiXing commented on HBASE-6520:
--------------------------------

bq. -1 core tests. The patch failed these unit tests:
bq.org.apache.hadoop.hbase.replication.TestReplication
bq.org.apache.hadoop.hbase.regionserver.TestSplitLogWorker

The patch does not modify anythong for the Replication and SplitLogWorker.

The TestReplication case failure may be caused by HBASE-3515 as the source code described.

And through the TestSplitLog log:
{code}
2012-08-07 14:25:24,200 INFO  [pool-1-thread-1] regionserver.TestSplitLogWorker(127): testAcquireTaskAtStartup
2012-08-07 14:25:24,280 INFO  [SplitLogWorker-rs,1,1] regionserver.SplitLogWorker(135): SplitLogWorker
rs,1,1 starting
2012-08-07 14:25:24,334 DEBUG [SplitLogWorker-rs,1,1] zookeeper.ZKUtil(1142): split-log-worker-tests-0x1390179cef50000
Retrieved 17 byte(s) of data from znode /hbase/splitlog/tatas; data=PBUF\x08\x00\x12\x09\x0A\x03m...
2012-08-07 14:25:24,375 INFO  [SplitLogWorker-rs,1,1] regionserver.SplitLogWorker(267): worker
rs,1,1 acquired task /hbase/splitlog/tatas
2012-08-07 14:25:24,375 INFO  [pool-1-thread-1] regionserver.SplitLogWorker(521): Sending
interrupt to stop the worker thread
2012-08-07 14:25:24,380 WARN  [SplitLogWorker-rs,1,1] regionserver.SplitLogWorker(292): task
execution prempted /hbase/splitlog/tatas
{code}
The SplitLogWorker started 14:25:24,280, and we will wait 100ms ,yes, at 14:25:24,380, but
at 14:25:24,375 we just grab the task, and our check thread will sleep every 10ms, so the
case failed.

Can we raise the wait time, such as 1000ms to reduce testSplitLogWorker case failure probability?
                
> MSLab May cause the Bytes.toLong does not work correctly for increment
> ----------------------------------------------------------------------
>
>                 Key: HBASE-6520
>                 URL: https://issues.apache.org/jira/browse/HBASE-6520
>             Project: HBase
>          Issue Type: Bug
>            Reporter: ShiXing
>            Assignee: ShiXing
>             Fix For: 0.96.0
>
>         Attachments: HBASE-6520-trunk-v1.patch
>
>
> When use MemStoreLAB, the KeyValues will share the byte array allocated by the MemStoreLAB,
all the KeyValues' "bytes" attributes are the same byte array. When use the functions such
as Bytes.toLong(byte[] bytes, int offset):
> {code}
>   public static long toLong(byte[] bytes, int offset) {
>     return toLong(bytes, offset, SIZEOF_LONG);
>   }
>   public static long toLong(byte[] bytes, int offset, final int length) {
>     if (length != SIZEOF_LONG || offset + length > bytes.length) {
>       throw explainWrongLengthOrOffset(bytes, offset, length, SIZEOF_LONG);
>     }
>     long l = 0;
>     for(int i = offset; i < offset + length; i++) {
>       l <<= 8;
>       l ^= bytes[i] & 0xFF;
>     }
>     return l;
>   }
> {code}
> If we do not put a long value to the KeyValue, and read it as a long value in HRegion.increment(),the
check 
> {code}
> offset + length > bytes.length
> {code}
> will take no effects, because the bytes.length is not equal to keyLength+valueLength,
indeed it is MemStoreLAB chunkSize which is default 2048 * 1024.
> I will paste the patch later.

--
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

        

Mime
View raw message