Skip to content

Commit c2a41cb

Browse files
teamconfxApache9
authored andcommitted
HBASE-27993 AbstractFSWAL causes ArithmeticException due to improper logRollSize value checking (#5390)
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org> (cherry picked from commit 8be9e51)
1 parent 55bb08f commit c2a41cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ protected long getFileNumFromFileName(Path fileName) {
379379
}
380380

381381
private int calculateMaxLogFiles(Configuration conf, long logRollSize) {
382+
checkArgument(logRollSize > 0,
383+
"The log roll size cannot be zero or negative when calculating max log files, "
384+
+ "current value is " + logRollSize);
382385
Pair<Long, MemoryType> globalMemstoreSize = MemorySizeUtil.getGlobalMemStoreSize(conf);
383386
return (int) ((globalMemstoreSize.getFirst() * 2) / logRollSize);
384387
}

0 commit comments

Comments
 (0)