[ https://issues.apache.org/jira/browse/HBASE-26197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17412136#comment-17412136 ]
Hudson commented on HBASE-26197: -------------------------------- Results for branch branch-2 [build #340 on builds.a.o|https://ci-hadoop.apache.org/job/HBase/job/HBase%20Nightly/job/branch-2/340/]: (x) *{color:red}-1 overall{color}* ---- details (if available): (/) {color:green}+1 general checks{color} -- For more information [see general report|https://ci-hadoop.apache.org/job/HBase/job/HBase%20Nightly/job/branch-2/340/General_20Nightly_20Build_20Report/] (x) {color:red}-1 jdk8 hadoop2 checks{color} -- For more information [see jdk8 (hadoop2) report|https://ci-hadoop.apache.org/job/HBase/job/HBase%20Nightly/job/branch-2/340/JDK8_20Nightly_20Build_20Report_20_28Hadoop2_29/] (/) {color:green}+1 jdk8 hadoop3 checks{color} -- For more information [see jdk8 (hadoop3) report|https://ci-hadoop.apache.org/job/HBase/job/HBase%20Nightly/job/branch-2/340/JDK8_20Nightly_20Build_20Report_20_28Hadoop3_29/] (/) {color:green}+1 jdk11 hadoop3 checks{color} -- For more information [see jdk11 report|https://ci-hadoop.apache.org/job/HBase/job/HBase%20Nightly/job/branch-2/340/JDK11_20Nightly_20Build_20Report_20_28Hadoop3_29/] (/) {color:green}+1 source release artifact{color} -- See build output for details. (/) {color:green}+1 client integration test{color} > Fix some obvious bugs in MultiByteBuff.put > ------------------------------------------ > > Key: HBASE-26197 > URL: https://issues.apache.org/jira/browse/HBASE-26197 > Project: HBase > Issue Type: Bug > Affects Versions: 3.0.0-alpha-1, 2.4.5 > Reporter: chenglei > Assignee: chenglei > Priority: Major > Fix For: 2.5.0, 3.0.0-alpha-2, 2.3.7, 2.4.7 > > > MultiByteBuff.put(int destOffset, ByteBuff src, int srcOffset, int length) > has some obvious bugs: > * It seems mix up {{items}} in {{src}} {{MutiByteBuff}} and {{items}} in the > {{dest}} {{MultiByteBuff}} , just as line 749 and line 754 illustrated. The > logic is only right when src {{ByteBuff}} is also a {{MultiByteBuff}} and > byte size of every {{ByteBuffer}} in {{src.items}} has exactly the same size > as every {{ByteBuffer}} in the {{dest.items}},but looking the usage of this > method in the hbase project, obviously the assumption is not right. > {code:java} > 746 public MultiByteBuff put(int offset, ByteBuff src, int srcOffset, int > length) { > 747 checkRefCount(); > 748 int destItemIndex = getItemIndex(offset); > 749 int srcItemIndex = getItemIndex(srcOffset); > 750 ByteBuffer destItem = this.items[destItemIndex]; > 751 offset = offset - this.itemBeginPos[destItemIndex]; > 752 > 753 ByteBuffer srcItem = getItemByteBuffer(src, srcItemIndex); > 754 srcOffset = srcOffset - this.itemBeginPos[srcItemIndex]; > ... > {code} > > * If src is {{SingleByteBuff}} and its remaining space is fewer than > length,when remaining space is exhausted, this {{MultiByteBuff.put}} method > would not throw any exception and continue to put src {{ByteBuff}} once again > from position 0 because following {{MultiByteBuff.getItemByteBuffer}} ignores > index paramter for {{SingleByteBuff}} . Obviously, this behavior is much > strange and unexpected. > {code:java} > private static ByteBuffer getItemByteBuffer(ByteBuff buf, int index) { > return (buf instanceof SingleByteBuff) ? buf.nioByteBuffers()[0] > : ((MultiByteBuff) buf).items[index]; > } > {code} > Why seems tests is OK with too much bugs? Because in normal cases, we just > use {{SingleByteBuff}} not {{MultiByteBuff}}. -- This message was sent by Atlassian Jira (v8.3.4#803005)