-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-27053 IOException during caching of uncompressed block to the block cache #4610
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
d1f67b2
to
2531a95
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
d8ce9bb
to
02c85ab
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@apurtell this is ready for review now. The last build was successful, I just pushed a small cleanup. @Apache9 you may be interested in this. I know you aren't super familiar with the BucketCache, but this is mostly just related to how we read HFileBlocks from disks. I think there is another potential solution here which is likely a lot simpler -- Similar to #4453, modify HFileBlockDefaultDecodingContext.prepareDecoding to always fill out the checksum bytes. In that PR he fills out the bytes with zero's. It seems like if we're going to leave space for the checksum, we should instead just do another That said, this solution is more cpu and space efficient, because we aren't leaving space for or copying over a checksum that we will never use. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@@ -1709,6 +1700,9 @@ protected HFileBlock readBlockDataInternal(FSDataInputStream is, long offset, | |||
if (verifyChecksum && !validateChecksum(offset, curBlock, hdrSize)) { | |||
return null; | |||
} | |||
// remove checksum from buffer now that it's verified | |||
int sizeWithoutChecksum = curBlock.getInt(Header.ON_DISK_DATA_SIZE_WITH_HEADER_INDEX); | |||
curBlock = curBlock.duplicate().limit(sizeWithoutChecksum); |
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.
Do we need to duplicate here? The old instance could be reference by others?
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 reviewing and good catch. I just pushed a fix for that. I also added a few more assertions to my new test
🎊 +1 overall
This message was automatically generated. |
@@ -1709,6 +1700,9 @@ protected HFileBlock readBlockDataInternal(FSDataInputStream is, long offset, | |||
if (verifyChecksum && !validateChecksum(offset, curBlock, hdrSize)) { | |||
return null; | |||
} | |||
// remove checksum from buffer now that it's verified | |||
int sizeWithoutChecksum = curBlock.getInt(Header.ON_DISK_DATA_SIZE_WITH_HEADER_INDEX); | |||
curBlock = curBlock.limit(sizeWithoutChecksum); |
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.
This is just a no op? curBlock.limit just returns curBlock itself?
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.
ok. I personally prefer to use the returned value in cases like this, in case the implementation changes. but i'm happy to not do that if it's more generally preferred. i just pushed a change to remove that.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Test looks unrelated, but I ran it locally anyway and it looks good. |
…lock cache (#4610) Signed-off-by: Duo Zhang <zhangduo@apache.org> Reviewed-by: wenwj0 <wenweijian2@huawei.com>
…lock cache (#4610) Signed-off-by: Duo Zhang <zhangduo@apache.org> Reviewed-by: wenwj0 <wenweijian2@huawei.com>
…lock cache (#4610) Signed-off-by: Duo Zhang <zhangduo@apache.org> Reviewed-by: wenwj0 <wenweijian2@huawei.com>
…sed block to the block cache (apache#4610) Signed-off-by: Duo Zhang <zhangduo@apache.org> Reviewed-by: wenwj0 <wenweijian2@huawei.com>
…lock cache (apache#4610) Signed-off-by: Duo Zhang <zhangduo@apache.org> Reviewed-by: wenwj0 <wenweijian2@huawei.com> (cherry picked from commit 33b25ab) Change-Id: Ibfb9c84979d19b765baae48fd66e17a46de2bcd5
Tests a different fix for HBASE-27053, based on analysis I posted in the issue.