-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-22965 RS Crash due to DBE reference to an reused ByteBuff #603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
💔 -1 overall
This message was automatically generated. |
🎊 +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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done it
return prevCell; | ||
} | ||
|
||
public void beforeShipped() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not making it ShipperListener. That would be best
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If do so, we should move ShipperListener to hbase-common first
@@ -840,6 +841,16 @@ public boolean isSharedMem() { | |||
/** Meta data that holds information about the hfileblock**/ | |||
private HFileContext fileContext; | |||
|
|||
void beforeShipped() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not making it ShipperListener. That would be best
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done it
@@ -781,6 +783,11 @@ public Cell getLastCell() { | |||
return lastCell; | |||
} | |||
|
|||
@VisibleForTesting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace the UT with TestHFile#testDBEShipped
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the feedback
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
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.