[jira] [Comment Edited] (HBASE-21401) Sanity check in BaseDecoder#parseCell

2018-11-11 Thread Zheng Hu (JIRA)


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

Zheng Hu edited comment on HBASE-21401 at 11/12/18 3:45 AM:


OK, I've revert the patch for branch-2.x firstly... will provide a patch for 
RowIndexSeekerV1.. 


was (Author: openinx):
OK, I revert the patch for branch-2.x firstly... will provide a patch for 
RowIndexSeekerV1.. 

> Sanity check in BaseDecoder#parseCell
> -
>
> Key: HBASE-21401
> URL: https://issues.apache.org/jira/browse/HBASE-21401
> Project: HBase
>  Issue Type: Sub-task
>  Components: regionserver
>Reporter: Zheng Hu
>Assignee: Zheng Hu
>Priority: Critical
> Fix For: 3.0.0, 2.2.0, 2.0.3, 2.1.2
>
> Attachments: HBASE-21401.v1.patch, HBASE-21401.v2.patch, 
> HBASE-21401.v3.patch, HBASE-21401.v4.patch, HBASE-21401.v4.patch, 
> HBASE-21401.v5.patch
>
>
> In KeyValueDecoder & ByteBuffKeyValueDecoder,  we pass a byte buffer to 
> initialize the Cell without a sanity check (check each field's offset&len 
> exceed the byte buffer or not), so ArrayIndexOutOfBoundsException may happen 
> when read the cell's fields, such as HBASE-21379,  it's hard to debug this 
> kind of bug. 
> An earlier check will help to find such kind of bugs.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (HBASE-21401) Sanity check in BaseDecoder#parseCell

2018-11-11 Thread Zheng Hu (JIRA)


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

Zheng Hu edited comment on HBASE-21401 at 11/12/18 3:31 AM:


[~stack], Thanks for your replay.  

Read the comment in RB & JIRA.  Checked the master branch,  there isn't any 
checksum for request messages now, and I think the checksum calculation will 
have more time cost than the checkKeyValueBytes, because if n = bytes.length,  
checksum need O( n ) time cost,  but checkKeyValueBytes need O(1) time cost ( 
it will skip to read the specific offsets & lens).  On the other hand,   the 
reason why we need checkKeyValueBytes is : the different hbase-client version 
may send the mis-encoding bytes,  the checkKeyValueBytes ensure that the good 
keyvalues will be accepted, and if find a bad keyvalues, it will provide the 
detail what's wrong with the bad keyvalues. 

and you said: 
> If a bug in the decoder, fix that rather than 'check' all values all the time?
that's some difficult for the server side  to decide how to correct the wrong 
keyvalue bytes.  So i think reject the bad keyvalue request is the right way.. 

Thanks. 




was (Author: openinx):
[~stack], Thanks for your replay.  

Read the comment in RB & JIRA.  Checked the master branch,  there isn't any 
checksum for request messages now, and I think the checksum calculation will 
have more time cost than the checkKeyValueBytes, because if n = bytes.length,  
checksum need O(n) time cost,  but checkKeyValueBytes need O(1) time cost ( it 
will skip to read the specific offsets & lens).  On the other hand,   the 
reason why we need checkKeyValueBytes is : the different hbase-client version 
may send the mis-encoding bytes,  the checkKeyValueBytes ensure that the good 
keyvalues will be accepted, and if find a bad keyvalues, it will provide the 
detail what's wrong with the bad keyvalues. 

and you said: 
> If a bug in the decoder, fix that rather than 'check' all values all the time?
that's some difficult for the server side  to decide how to correct the wrong 
keyvalue bytes.  So i think reject the bad keyvalue request is the right way.. 

Thanks. 



> Sanity check in BaseDecoder#parseCell
> -
>
> Key: HBASE-21401
> URL: https://issues.apache.org/jira/browse/HBASE-21401
> Project: HBase
>  Issue Type: Sub-task
>  Components: regionserver
>Reporter: Zheng Hu
>Assignee: Zheng Hu
>Priority: Critical
> Fix For: 3.0.0, 2.2.0, 2.0.3, 2.1.2
>
> Attachments: HBASE-21401.v1.patch, HBASE-21401.v2.patch, 
> HBASE-21401.v3.patch, HBASE-21401.v4.patch, HBASE-21401.v4.patch, 
> HBASE-21401.v5.patch
>
>
> In KeyValueDecoder & ByteBuffKeyValueDecoder,  we pass a byte buffer to 
> initialize the Cell without a sanity check (check each field's offset&len 
> exceed the byte buffer or not), so ArrayIndexOutOfBoundsException may happen 
> when read the cell's fields, such as HBASE-21379,  it's hard to debug this 
> kind of bug. 
> An earlier check will help to find such kind of bugs.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (HBASE-21401) Sanity check in BaseDecoder#parseCell

2018-10-29 Thread Zheng Hu (JIRA)


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

Zheng Hu edited comment on HBASE-21401 at 10/29/18 1:31 PM:


TestTags#testFlushAndCompactionwithCombinations  failed because of ROW_INDEX_V1 
too. I believe there's a bug in ROW_INDEX_V1.


was (Author: openinx):
TestTags#testFlushAndCompactionwithCombinations  failed because of ROW_INDEX_V1 
too. I belive there's a bug in ROW_INDEX_V1.

> Sanity check in BaseDecoder#parseCell
> -
>
> Key: HBASE-21401
> URL: https://issues.apache.org/jira/browse/HBASE-21401
> Project: HBase
>  Issue Type: Sub-task
>  Components: regionserver
>Reporter: Zheng Hu
>Assignee: Zheng Hu
>Priority: Critical
> Fix For: 3.0.0, 2.2.0, 2.0.3, 2.1.2
>
> Attachments: HBASE-21401.v1.patch, HBASE-21401.v2.patch
>
>
> In KeyValueDecoder & ByteBuffKeyValueDecoder,  we pass a byte buffer to 
> initialize the Cell without a sanity check (check each field's offset&len 
> exceed the byte buffer or not), so ArrayIndexOutOfBoundsException may happen 
> when read the cell's fields, such as HBASE-21379,  it's hard to debug this 
> kind of bug. 
> An earlier check will help to find such kind of bugs.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)