David Capwell created CASSANDRA-20398:
-----------------------------------------

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


{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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to