{"record":{"id":"a872c846d2349e17","repo":"apache/cassandra","slug":"s-s-is-not-acceptable-size-must-be-at-least-s","errorCode":null,"errorMessage":"%s %s is not acceptable, size must be at least %s","messagePattern":"(.+?) (.+?) is not acceptable, size must be at least (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/compaction/unified/Controller.java","lineNumber":529,"sourceCode":"            }\n        }\n\n        // preserve the configuration for later use during min_sstable_size.\n        long targetSSTableSize = DEFAULT_TARGET_SSTABLE_SIZE;\n        s = options.remove(TARGET_SSTABLE_SIZE_OPTION);\n        if (s != null)\n        {\n            try\n            {\n                double targetSize = FBUtilities.parseHumanReadable(s, null, \"B\");\n                if (targetSize >= Long.MAX_VALUE) {\n                    throw new ConfigurationException(String.format(\"%s %s is out of range of Long.\",\n                                                                    TARGET_SSTABLE_SIZE_OPTION,\n                                                                    s));\n                }\n                if (targetSize < MIN_TARGET_SSTABLE_SIZE)\n                {\n                    throw new ConfigurationException(String.format(\"%s %s is not acceptable, size must be at least %s\",\n                                                                   TARGET_SSTABLE_SIZE_OPTION,\n                                                                   s,\n                                                                   FBUtilities.prettyPrintMemory(MIN_TARGET_SSTABLE_SIZE)));\n                }\n                targetSSTableSize = (long) Math.ceil(targetSize);\n            }\n            catch (NumberFormatException e)\n            {\n                throw new ConfigurationException(String.format(\"%s %s is not a valid size in bytes: %s\",\n                                                               TARGET_SSTABLE_SIZE_OPTION,\n                                                               s,\n                                                               e.getMessage()),\n                                                 e);\n            }\n        }\n\n        s = options.remove(FLUSH_SIZE_OVERRIDE_OPTION);\n        if (s != null)","sourceCodeStart":511,"sourceCodeEnd":547,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compaction/unified/Controller.java#L511-L547","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Increase target_sstable_size to at least MIN_TARGET_SSTABLE_SIZE (check the constant in Controller.java).","Remove the target_sstable_size option entirely to use the default value.","Verify the unit suffix — parse errors and tiny values usually come from wrong units (K vs KiB vs MiB)."],"exampleFix":"// before\ncompaction = {'class': 'UnifiedCompactionStrategy', 'target_sstable_size': '1MiB'}\n// after\ncompaction = {'class': 'UnifiedCompactionStrategy', 'target_sstable_size': '160MiB'}","handlingStrategy":"validation","validationCode":"long bytes = FBUtilities.parseHumanReadableBytes(opts.get(\"target_sstable_size\"));\nif (bytes < FBUtilities.getMinimumTargetSSTableSize()) throw new IllegalArgumentException(\"target_sstable_size too small\");","typeGuard":null,"tryCatchPattern":"try { schemaChange.apply(); } catch (ConfigurationException e) { logger.error(\"Invalid compaction option: {}\", e.getMessage()); }","preventionTips":["Check the MIN_TARGET_SSTABLE_SIZE constant before choosing a value","Always express sizes in MiB/GiB, not raw small byte counts","Validate compaction options against the same code path (validateOptions) in tooling before applying schema changes"],"tags":["cassandra","configuration","compaction","validation"],"backgroundTag":"value-out-of-range","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}