diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java index e173f1ebe775..cdeb7e84e06d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java @@ -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 globalMemstoreSize = MemorySizeUtil.getGlobalMemStoreSize(conf); return (int) ((globalMemstoreSize.getFirst() * 2) / logRollSize); }