Maxwell-Guo commented on code in PR #4228:
URL: https://github.com/apache/cassandra/pull/4228#discussion_r2189026035


##########
src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java:
##########
@@ -600,6 +605,19 @@ public static Map<String, String> 
validateOptions(Map<String, String> options) t
             throw new ConfigurationException(String.format("%s is not a 
parsable int (base10) for %s", size, LEVEL_FANOUT_SIZE_OPTION), ex);
         }
 
+        // Validate max Bytes for a level
+        try {
+            long maxSSTableSizeInBytes = Math.multiplyExact(ssSize, 1024L * 
1024L); // Convert MB to Bytes
+            double maxBytes = Math.pow(fanoutSize, MAX_LEVEL_COUNT) * 
maxSSTableSizeInBytes;
+            if (Double.isInfinite(maxBytes) || maxBytes > Long.MAX_VALUE)

Review Comment:
   I think there may exist some problem here, maxBytes is a double and 
Long.Max_VALUE is a Long ,there may be a loss of precision when doing 
comparison. 
    it is better to use decimal 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to