ethan-brown2022 commented on code in PR #2966:
URL: https://github.com/apache/cassandra/pull/2966#discussion_r1419119033


##########
src/java/org/apache/cassandra/db/compaction/unified/Controller.java:
##########
@@ -596,10 +598,10 @@ public static Map<String, String> 
validateOptions(Map<String, String> options) t
             try
             {
                 long sizeInBytes = FBUtilities.parseHumanReadableBytes(s);
-                if (sizeInBytes < 0)
-                    throw new ConfigurationException(String.format("Invalid 
configuration, %s should be positive: %s",
+                if (sizeInBytes < targetSSTableSize)

Review Comment:
   UCS aims to produce sstables with size between $t / \sqrt 2$ and $t \cdot 
\sqrt 2$ (More information can be found 
[here](https://github.com/apache/cassandra/blob/cassandra-5.0/src/java/org/apache/cassandra/db/compaction/UnifiedCompactionStrategy.md)).
  We should verify that `sizeInBytes > targetSSTableSize * INVERSE_SQRT_2`



##########
test/unit/org/apache/cassandra/db/compaction/unified/ControllerTest.java:
##########
@@ -207,11 +209,13 @@ public void testGetNumShards()
         Map<String, String> options = new HashMap<>();
         options.putIfAbsent(Controller.BASE_SHARD_COUNT_OPTION, 
Integer.toString(3));
         options.putIfAbsent(Controller.TARGET_SSTABLE_SIZE_OPTION, 
FBUtilities.prettyPrintMemory(100 << 20));
-        options.put(Controller.MIN_SSTABLE_SIZE_OPTION, "0B");
         options.put(Controller.SSTABLE_GROWTH_OPTION, "0.0");
         Controller.validateOptions(options);
+        // this is a provably invalid setting but required for this test.

Review Comment:
   This is a valid setting.  With `min_sstable_size = 0`, the feature is 
disabled.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to