-
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-27989. ByteBuffAllocator causes ArithmeticException due to improper poolBufSize value checking #5388
Conversation
🎊 +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. |
int bufsForTwoMB = (2 * 1024 * 1024) / poolBufSize; | ||
int maxBuffCount = | ||
conf.getInt(MAX_BUFFER_COUNT_KEY, conf.getInt(HConstants.REGION_SERVER_HANDLER_COUNT, | ||
HConstants.DEFAULT_REGION_SERVER_HANDLER_COUNT) * bufsForTwoMB * 2); | ||
int minSizeForReservoirUse = conf.getInt(MIN_ALLOCATE_SIZE_KEY, poolBufSize / 6); | ||
if (minSizeForReservoirUse == 0) { |
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.
What if minSizeForReservoirUse < 0 here?
@Apache9 I pushed a new checking logic for both zero and negative value. |
🎊 +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. |
…per poolBufSize value checking (#5388) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit bfc5375)
…per poolBufSize value checking (#5388) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit bfc5375)
…per poolBufSize value checking (#5388) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit bfc5375)
…per poolBufSize value checking (#5388) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit bfc5375)
…per poolBufSize value checking (#5388) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit bfc5375)
Description of PR
https://issues.apache.org/jira/browse/HBASE-27989
This PR prohibits setting
hbase.server.allocator.buffer.size
to 0 or negative. A warning is also added if the minimum size for reservoir use is set to zero.How was this patch tested?
hbase.server.allocator.buffer.size=0
org.apache.hadoop.hbase.io.hfile.bucket.TestBucketCacheRefCnt#testInBucketCache
The test now throws an
IllegalArgumentException
with detailed message.