apache/cassandra · error · ConfigurationException

write_tombstone_warn_threshold (%d) must be -1 (disabled) or

Error message

write_tombstone_warn_threshold (%d) must be -1 (disabled) or >= 0

What it means

Startup validation error for the write_tombstone_warn_threshold setting: the value must be -1 (threshold disabled) or a non-negative quantity. Any value below -1 is rejected during DatabaseDescriptor config validation, before the threshold is used to warn on oversized writes.

Source

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

        if (fail != null && warn != null && fail.toBytes() < warn.toBytes())
            throw new ConfigurationException(String.format("%s (%s) must be greater than or equal to %s (%s)",
                                                           name + "_fail_threshold", fail,
                                                           name + "_warn_threshold", warn));
    }

    private static void validateWriteSizeThreshold(DataStorageSpec.LongBytesBound writeSizeWarn, DataStorageSpec.LongBytesBound minTrackedSize)
    {
        if (writeSizeWarn != null && minTrackedSize != null)
        {
            if (writeSizeWarn.toBytes() < minTrackedSize.toBytes())
                throw new ConfigurationException(String.format("write_size_warn_threshold (%s) cannot be less than min_tracked_partition_size (%s)", writeSizeWarn, minTrackedSize));
        }
    }

    private static void validateWriteTombstoneThresholdRange(int writeTombstoneWarn, long minTrackedTombstoneCount)
    {
        if (writeTombstoneWarn < -1)
            throw new ConfigurationException(String.format("write_tombstone_warn_threshold (%d) must be -1 (disabled) or >= 0", writeTombstoneWarn));

        if (writeTombstoneWarn != -1 && writeTombstoneWarn < minTrackedTombstoneCount)
            throw new ConfigurationException(String.format("write_tombstone_warn_threshold (%d) cannot be less than min_tracked_partition_tombstone_count (%d)",
                                                           writeTombstoneWarn, minTrackedTombstoneCount));
    }

    public static GuardrailsOptions getGuardrailsConfig()
    {
        return guardrails;
    }

    private static void applyGuardrails()
    {
        try
        {
            guardrails = new GuardrailsOptions(conf);
        }
        catch (IllegalArgumentException e)

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Set write_tombstone_warn_threshold to -1 to disable, or 0 or a positive count
  2. Correct any accidental extra digits in a negative literal
  3. Re-run startup after the fix

Example fix

// before (cassandra.yaml)
write_tombstone_warn_threshold: -100
// after
write_tombstone_warn_threshold: -1
Defensive patterns

Strategy: validation

Validate before calling

int t = conf.write_tombstone_warn_threshold;
if (t < -1) throw new IllegalArgumentException("write_tombstone_warn_threshold must be -1 or >= 0: " + t);

Try / catch

try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { LOG.error("Bad tombstone warn threshold: " + e.getMessage()); System.exit(1); }

Prevention

When it happens

Trigger: cassandra.yaml (or Config) with write_tombstone_warn_threshold set to -2 or any negative value other than -1, during DatabaseDescriptor validation.

Common situations: Operator using a negative number intending 'disable' but writing e.g. -100; scripted config generation emitting -1-with-offset values; misunderstanding that only exactly -1 disables the check.

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/e1c88232486448d1. Report an issue: GitHub.