apache/cassandra · error · ConfigurationException

%s %s is not acceptable, size must be at least %s

Error message

%s %s is not acceptable, size must be at least %s

What it means

Unified compaction strategy controller validation rejects a target_sstable_size option that parses to fewer bytes than MIN_TARGET_SSTABLE_SIZE. Cassandra requires a minimum sstable size so the unified strategy's size-tiered math remains meaningful; anything smaller is considered a configuration mistake. The value is parsed as human-readable bytes (e.g. '160MiB') before this range check.

Source

Thrown at src/java/org/apache/cassandra/db/compaction/unified/Controller.java:529

            }
        }

        // preserve the configuration for later use during min_sstable_size.
        long targetSSTableSize = DEFAULT_TARGET_SSTABLE_SIZE;
        s = options.remove(TARGET_SSTABLE_SIZE_OPTION);
        if (s != null)
        {
            try
            {
                double targetSize = FBUtilities.parseHumanReadable(s, null, "B");
                if (targetSize >= Long.MAX_VALUE) {
                    throw new ConfigurationException(String.format("%s %s is out of range of Long.",
                                                                    TARGET_SSTABLE_SIZE_OPTION,
                                                                    s));
                }
                if (targetSize < MIN_TARGET_SSTABLE_SIZE)
                {
                    throw new ConfigurationException(String.format("%s %s is not acceptable, size must be at least %s",
                                                                   TARGET_SSTABLE_SIZE_OPTION,
                                                                   s,
                                                                   FBUtilities.prettyPrintMemory(MIN_TARGET_SSTABLE_SIZE)));
                }
                targetSSTableSize = (long) Math.ceil(targetSize);
            }
            catch (NumberFormatException e)
            {
                throw new ConfigurationException(String.format("%s %s is not a valid size in bytes: %s",
                                                               TARGET_SSTABLE_SIZE_OPTION,
                                                               s,
                                                               e.getMessage()),
                                                 e);
            }
        }

        s = options.remove(FLUSH_SIZE_OVERRIDE_OPTION);
        if (s != null)

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Increase target_sstable_size to at least MIN_TARGET_SSTABLE_SIZE (check the constant in Controller.java).
  2. Remove the target_sstable_size option entirely to use the default value.
  3. Verify the unit suffix — parse errors and tiny values usually come from wrong units (K vs KiB vs MiB).

Example fix

// before
compaction = {'class': 'UnifiedCompactionStrategy', 'target_sstable_size': '1MiB'}
// after
compaction = {'class': 'UnifiedCompactionStrategy', 'target_sstable_size': '160MiB'}
Defensive patterns

Strategy: validation

Validate before calling

long bytes = FBUtilities.parseHumanReadableBytes(opts.get("target_sstable_size"));
if (bytes < FBUtilities.getMinimumTargetSSTableSize()) throw new IllegalArgumentException("target_sstable_size too small");

Try / catch

try { schemaChange.apply(); } catch (ConfigurationException e) { logger.error("Invalid compaction option: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Setting compaction option 'target_sstable_size' to a value below MIN_TARGET_SSTABLE_SIZE (e.g. '1KiB') via CREATE TABLE WITH compaction options, cassandra.yaml, or ALTER TABLE, which calls Controller.validateOptions.

Common situations: Typos like '160K' when the author meant '160MiB'; copying an option from another strategy where tiny sstables were acceptable; aggressive tuning experiments for test clusters.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/a872c846d2349e17. Report an issue: GitHub.