Skip to content

Commit

Permalink
HBASE-27993 AbstractFSWAL causes ArithmeticException due to improper …
Browse files Browse the repository at this point in the history
…logRollSize value checking (#5390)

Signed-off-by: Duo Zhang <[email protected]>
Signed-off-by: Wei-Chiu Chuang <[email protected]>
(cherry picked from commit 8be9e51)
  • Loading branch information
teamconfx authored and Apache9 committed Mar 28, 2024
1 parent 55bb08f commit c2a41cb
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@ protected long getFileNumFromFileName(Path fileName) {
}

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

0 comments on commit c2a41cb

Please sign in to comment.