Uh oh!
There was an error while loading. Please reload this page.
HBASE-22965 RS Crash due to DBE reference to an reused ByteBuff - #603
Conversation
Apache-HBase
commented
Sep 10, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 10, 2019
🎊 +1 overall
This message was automatically generated. |
| public void beforeShipped() { | ||
| if (this.prevCell != null) { | ||
| this.prevCell = KeyValueUtil.copyToNewKeyValue(this.prevCell); |
There was a problem hiding this comment.
Seems we need both key and value from the prevCell in FastDiffDeltaEncoder and all. Just add a comment saying so. Normally we copy the key part alone in beforeShipped
| return prevCell; | ||
| } | ||
| public void beforeShipped() { |
There was a problem hiding this comment.
Why not making it ShipperListener. That would be best
There was a problem hiding this comment.
If do so, we should move ShipperListener to hbase-common first
| /** Meta data that holds information about the hfileblock**/ | ||
| private HFileContext fileContext; | ||
| void beforeShipped() { |
There was a problem hiding this comment.
Why not making it ShipperListener. That would be best
| return lastCell; | ||
| } | ||
| @VisibleForTesting |
There was a problem hiding this comment.
So many method exposes for the test-ability. Are we really testing the FT way? That a prevCell been passed and we pollute that cell's backing BB/byte[] after a shipped call? That would be the best and in that I dont think we need to expose these many method.
There was a problem hiding this comment.
replace the UT with TestHFile#testDBEShipped
Apache-HBase
commented
Sep 12, 2019
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 18, 2019
💔 -1 overall
This message was automatically generated. |
chenxu14
commented
Sep 27, 2019
Hi @anoopsjohn , do you think the PR is OK now? or do I need to make any adjustments? |
| writer.beforeShipped(); | ||
| Cell cell = writer.blockWriter.getEncodingState().getLastCell(); | ||
| assertTrue(cell instanceof KeyValue); |
There was a problem hiding this comment.
The UT is not really doing a meaningful test. Write a cell first and then pollute its backing ByteBuffer by directly manipulating few bytes which comes at some KeyLen part or so. Then write another cell. Call the beforeShipped() before manipulating this 1st BB. With out the patch, we will end up in some issues. The patch should fix it.
Even we can remove all these new getters exposed in different classes for testing.
There was a problem hiding this comment.
thanks for the feedback
Apache-HBase
commented
Sep 27, 2019
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 28, 2019
💔 -1 overall
This message was automatically generated. |
Signed-off-by: huzheng <openinx@gmail.com>
Signed-off-by: huzheng <openinx@gmail.com>
Signed-off-by: huzheng <openinx@gmail.com>
…he#603) Signed-off-by: huzheng <openinx@gmail.com>
No description provided.