[ 
https://issues.apache.org/jira/browse/HBASE-27993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17832315#comment-17832315
 ] 

Hudson commented on HBASE-27993:
--------------------------------

Results for branch branch-2.5
        [build #503 on 
builds.a.o|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/503/]:
 (/) *{color:green}+1 overall{color}*
----
details (if available):

(/) {color:green}+1 general checks{color}
-- For more information [see general 
report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/503/General_20Nightly_20Build_20Report/]


(/) {color:green}+1 jdk8 hadoop2 checks{color}
-- For more information [see jdk8 (hadoop2) 
report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/503/JDK8_20Nightly_20Build_20Report_20_28Hadoop2_29/]


(/) {color:green}+1 jdk8 hadoop3 checks{color}
-- For more information [see jdk8 (hadoop3) 
report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/503/JDK8_20Nightly_20Build_20Report_20_28Hadoop3_29/]


(/) {color:green}+1 jdk11 hadoop3 checks{color}
-- For more information [see jdk11 
report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/503/JDK11_20Nightly_20Build_20Report_20_28Hadoop3_29/]


(/) {color:green}+1 source release artifact{color}
-- See build output for details.


(/) {color:green}+1 client integration test{color}


> AbstractFSWAL causes ArithmeticException due to improper logRollSize value 
> checking
> -----------------------------------------------------------------------------------
>
>                 Key: HBASE-27993
>                 URL: https://issues.apache.org/jira/browse/HBASE-27993
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: ConfX
>            Assignee: ConfX
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 2.4.18, 2.7.0, 3.0.0-beta-2, 2.6.1, 2.5.9
>
>         Attachments: reproduce.sh
>
>
> h2. What happened
> There is no value checking for parameter 
> {{hbase.regionserver.logroll.multiplier}} when {{hbase.wal.provider}} is set 
> to {{multiwal}}. This may cause improper calculations and crashes the system 
> like division by 0.
> h2. Buggy code
> In {{AbstractFSWAL.java}}, there is no value checking for {{logRollSize and 
> this variable is directly used while calculating the value of maxLogFiles in 
> the method calculateMaxLogFiles}}. When logRollSize is mistakenly set to 0, 
> the code would cause division by 0 and throw {{ArithmeticException}} to crash 
> the system.
> {noformat}
>      private int calculateMaxLogFiles(Configuration conf, long logRollSize) {
>     Pair<Long, MemoryType> globalMemstoreSize = 
> MemorySizeUtil.getGlobalMemStoreSize(conf);
>     return (int) ((globalMemstoreSize.getFirst() * 2) / logRollSize);
>   }{noformat}
> h2. How to reproduce
> (1) set hbase.regionserver.logroll.multiplier=0.0 and 
> hbase.wal.provider=multiwal
> (2) run org.apache.hadoop.hbase.wal.TestWALMethods#testGetSplitEditFilesSorted
> you should observe the following failure:
> {noformat}
> java.lang.ArithmeticException: / by zero
>       at 
> org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL.calculateMaxLogFiles(AbstractFSWAL.java:466)
>   at 
> org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL.<init>(AbstractFSWAL.java:594)
>         at 
> org.apache.hadoop.hbase.regionserver.wal.AsyncFSWAL.<init>(AsyncFSWAL.java:141)
>         . . .{noformat}
> For an easy reproduction, run the reproduce.sh in the attachment.
> We are happy to provide a patch if this issue is confirmed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to