apache/cassandra · error · java.lang.IllegalArgumentException

Threshold value for gc_log*_threshold (%d) must be less than

Error message

Threshold value for gc_log*_threshold (%d) must be less than gc_warn*_threshold which is currently %d

What it means

Cassandra throws this IllegalArgumentException when the GC log threshold is greater than the GC warn threshold (and warn threshold is non-zero). A pause must be logged before it is warned, so gc_log_threshold must be strictly less than gc_warn_threshold.

Source

Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:5023

    {
        validateGCParams(threshold, getGCWarnThreshold());
        conf.gc_log_threshold = new DurationSpec.IntMillisecondsBound(threshold);
    }

    public static void validateGCParams(long logThreshold, long warnThreshold)
    {
        if (logThreshold <= 0)
            throw new IllegalArgumentException("Threshold value for gc_log*_threshold must be greater than 0");
        if (logThreshold > Integer.MAX_VALUE)
            throw new IllegalArgumentException("Threshold value for gc_log*_threshold must be less than Integer.MAX_VALUE");

        if (warnThreshold <= 0)
            throw new IllegalArgumentException("Threshold value for gc_warn*_threshold must be greater than 0");
        if (warnThreshold > Integer.MAX_VALUE)
            throw new IllegalArgumentException("Threshold value for gc_warn*_threshold must be less than Integer.MAX_VALUE");

        if (warnThreshold != 0 && logThreshold > warnThreshold)
            throw new IllegalArgumentException("Threshold value for gc_log*_threshold (" + logThreshold + ") must be less than gc_warn*_threshold which is currently "
                    + warnThreshold);
    }

    public static EncryptionContext getEncryptionContext()
    {
        return encryptionContext;

    }

    public static long getGCWarnThreshold()
    {
        return conf.gc_warn_threshold.toMilliseconds();
    }

    public static void setGCWarnThreshold(long threshold)
    {
        if (threshold < 0)
            throw new IllegalArgumentException("Threshold value for gc_warn_threshold must be greater than or equal to 0");

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Ensure gc_log_threshold < gc_warn_threshold (e.g. log=200ms, warn=1000ms)
  2. Swap the values if they were entered in the wrong order
  3. Re-validate after changing either threshold via JMX

Example fix

// before (cassandra.yaml)
gc_log_threshold: 2000ms
gc_warn_threshold: 1000ms
// after
gc_log_threshold: 200ms
gc_warn_threshold: 1000ms
Defensive patterns

Strategy: validation

Validate before calling

if (warnThreshold != 0 && logThreshold >= warnThreshold)
    throw new IllegalArgumentException("gc_log_threshold must be less than gc_warn_threshold");

Try / catch

try {
    DatabaseDescriptor.validateGCParams(logThreshold, warnThreshold);
} catch (IllegalArgumentException e) {
    logger.error("GC thresholds misordered: log must be < warn", e);
}

Prevention

When it happens

Trigger: Calling validateGCParams(logThreshold, warnThreshold) with warnThreshold != 0 and logThreshold > warnThreshold; also startup validation when cassandra.yaml has gc_log_threshold >= gc_warn_threshold.

Common situations: Operators raising the log threshold above the warn threshold while tuning, or swapping the two values in cassandra.yaml.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


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