apache/cassandra · error · IllegalArgumentException

Invalid parameter list for sequence distribution (min>max):

Error message

Invalid parameter list for sequence distribution (min>max): 

What it means

Guard in OptionDistribution.getFactory for the 'seq' distribution: the min:max bounds parsed from the single parameter were inverted (min > max), so no valid increasing sequence exists. Thrown as IllegalArgumentException for malformed stress CLI distribution arguments.

Solutions

  1. Swap the bounds so min comes first: SEQ(1..1000)
  2. Normalize in code with Math.min/Math.max before building the spec string
  3. If descending iteration is intended, iterate a normal range in reverse instead.

Example fix

// before
-pop seq=SEQ(1000..1)
// after
-pop seq=SEQ(1..1000)
Defensive patterns

Strategy: validation

Validate before calling

long lo = Math.min(a, b), hi = Math.max(a, b); String spec = "SEQ(" + lo + ".." + hi + ")";

Try / catch

try { DistributionFactory f = seq.getFactory(params); } catch (IllegalArgumentException e) { normalizeBoundsAndRetry(); }

Prevention

When it happens

Trigger: SEQ spec with bounds in descending order, e.g. SEQ(1000..1) or SEQ(-5..-100).

Common situations: Hand-typed ranges written high-to-low out of habit; bounds read from config in reverse order; programmatically generated specs without ordering normalization.

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

Appendix: source

Thrown at tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:393

        {
            if (params.size() != 1)
                throw new IllegalArgumentException("Invalid parameter list for sequence distribution: " + params);
            final long min;
            final long max;
            try
            {
                String[] bounds = params.get(0).split("\\.\\.+");
                min = parseLong(bounds[0]);
                max = parseLong(bounds[1]);
            } catch (Exception ignore)
            {
                throw new IllegalArgumentException("Invalid parameter list for sequence distribution: " + params);
            }
            if (min == max)
                throw new IllegalArgumentException("Invalid parameter list for sequence distribution (min==max): " + params);

            if (min > max)
                throw new IllegalArgumentException("Invalid parameter list for sequence distribution (min>max): " + params);

            return new SequenceFactory(min, max);

        }
    }


    private static final class InverseFactory implements DistributionFactory
    {
        final DistributionFactory wrapped;
        private InverseFactory(DistributionFactory wrapped)
        {
            this.wrapped = wrapped;
        }

        public Distribution get()
        {
            return new DistributionInverted(wrapped.get());

View on GitHub (pinned to 88fd0f6a0e)