-
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-27990. BucketCache causes ArithmeticException due to improper blockSize value checking #5389
Conversation
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@@ -273,6 +273,7 @@ public BucketCache(String ioEngineName, long capacity, int blockSize, int[] buck | |||
public BucketCache(String ioEngineName, long capacity, int blockSize, int[] bucketSizes, | |||
int writerThreadNum, int writerQLen, String persistencePath, int ioErrorsTolerationDuration, | |||
Configuration conf) throws IOException { | |||
Preconditions.checkArgument(blockSize > 0, "BucketCache capacity can not be less than 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.
Better to include the incorrect blockSize value in the error message.
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
💔 -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. |
…ockSize value checking (#5389) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 5a0c4de)
…ockSize value checking (#5389) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 5a0c4de)
…ockSize value checking (#5389) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 5a0c4de)
…ockSize value checking (#5389) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 5a0c4de)
…ockSize value checking (#5389) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 5a0c4de)
Description of PR
https://issues.apache.org/jira/browse/HBASE-27990
This PR adds a precheck for
hbase.blockcache.minblocksize
such that it must be positive.How was this patch tested?
(1) set hbase.blockcache.minblocksize=0
(2) run org.apache.hadoop.hbase.io.hfile.TestCacheConfig#testBucketCacheConfigL1L2Setup
The test throws a IllegalArgumentException rather than a division by zero error.