blambov commented on code in PR #2896:
URL: https://github.com/apache/cassandra/pull/2896#discussion_r1415618917


##########
src/java/org/apache/cassandra/db/compaction/unified/Controller.java:
##########
@@ -268,9 +268,10 @@ public int getNumShards(double localDensity)
         if (minSSTableSize > 0)
         {
             double count = localDensity / minSSTableSize;
-            // Minimum size only applies if it is smaller than the base count.
+            // Minimum size only applies if the base count would result in 
smaller sstables.
+            // We also want to use the min size if we don't yet know the flush 
size (density is NaN).
             // Note: the minimum size cannot be larger than the target size's 
minimum.
-            if (count < baseShardCount)
+            if (!(count >= baseShardCount)) // also true for count == NaN

Review Comment:
   Tests typically run with unknown flush size and we want them to use just one 
shard.
   
   It also generally makes better sense to start non-splitting if we don't know 
what size we should expect.



-- 
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