[ https://issues.apache.org/jira/browse/CASSANDRA-20398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17941412#comment-17941412 ]
Pranav commented on CASSANDRA-20398: ------------------------------------ [~dcapwell] can I pick this up? I looked into this issue and I think we could the following changes. Please let me know if this is the right direction. # In the first case, the target_size is going beyond INT_MAX. Should we have a logic to check if it goes beyond INT MAX and log it specifically so that the user will get the accurate description? # In the second case, should we modify the log to explicity specify that the target size is 70% of the user inputs? Thanks. > Unified Compaction does not properly validate min and target sizes > ------------------------------------------------------------------ > > Key: CASSANDRA-20398 > URL: https://issues.apache.org/jira/browse/CASSANDRA-20398 > Project: Apache Cassandra > Issue Type: Bug > Components: Local/Compaction/UCS > Reporter: David Capwell > Priority: Normal > Fix For: 5.0.x > > > {code} > AND compaction = {'base_shard_count': '7', 'class': > 'org.apache.cassandra.db.compaction.UnifiedCompactionStrategy', > 'flush_size_override': '492E+207 KiB', 'min_sstable_size': '871 GiB', > 'provide_overlapping_tombstones': 'CELL', 'target_sstable_size': '12E899 B'} > {code} > In this example min_sstable_size < target_sstable_size but the error the user > sees is > {code} > Caused by: org.apache.cassandra.exceptions.ConfigurationException: Invalid > configuration, min_sstable_size (871.000GiB) should be less than the target > size minimum: 2.000GiB at > org.apache.cassandra.db.compaction.unified.Controller.validateOptions(Controller.java:627) > at > org.apache.cassandra.db.compaction.UnifiedCompactionStrategy.validateOptions(UnifiedCompactionStrategy.java:106) > {code} > The variables in question for this error > {code} > targetSSTableSize = 9223372036854775807 > sizeInBytes = 935229128704 > limit = 2147483647 // (int) (targetSSTableSize * Math.sqrt(0.5)) > {code} > The issue here is that the target size is larger than int max so we wrap > around! > {code} > sizeInBytes >= Math.ceil(targetSSTableSize * INVERSE_SQRT_2) == false > sizeInBytes >= (int) Math.ceil(targetSSTableSize * INVERSE_SQRT_2) == true > {code} > Here is another example where the error isn't clear but isn't due to wrap > arround > {code} > AND compaction = {'base_shard_count': '2', 'class': > 'org.apache.cassandra.db.compaction.UnifiedCompactionStrategy', > 'min_sstable_size': '437.825 MiB', 'scaling_parameters': > 'T2,N,1961141729,-163573937,L10,L3,T4,N,N', 'target_sstable_size': '+565 MiB'} > {code} > {code} > Caused by: org.apache.cassandra.exceptions.ConfigurationException: Invalid > configuration, min_sstable_size (437.825MiB) should be less than the target > size minimum: 399.515MiB > at > org.apache.cassandra.db.compaction.unified.Controller.validateOptions(Controller.java:627) > {code} > Here the same variables above are > {code} > targetSSTableSize = 592445440 > sizeInBytes = 459092787 > limit = 418922189 > {code} > This looks to be due to the 70% (INVERSE_SQRT_2) on the target, so the error > uses a value the user doesn't provide but rather one that is calculated. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org