apache/cassandra · error · IllegalArgumentException

Progress barrier only supports ALL, EACH_QUORUM…

Error message

Progress barrier only supports ALL, EACH_QUORUM, LOCAL_QUORUM, QUORUM, ONE and NODE_LOCAL, but not 

What it means

Thrown by ProgressBarrier.await when a consistency level not supported by the progress barrier (anything other than ALL, EACH_QUORUM, LOCAL_QUORUM, QUORUM, ONE, NODE_LOCAL) is passed. The barrier maps each supported CL to a waiter strategy (WaitForAll/Quorum/One/None); other CLs have no defined waiter.

Solutions

  1. Pass one of the supported levels: ALL, EACH_QUORUM, LOCAL_QUORUM, QUORUM, ONE, or NODE_LOCAL
  2. Map unsupported CLs before calling await (e.g. treat TWO/THREE as QUORUM if semantically acceptable)
  3. Add an explicit switch case for the new CL in ProgressBarrier if it genuinely needs support
  4. Validate/whitelist the CL at the API boundary that feeds await

Example fix

// before
barrier.await(ConsistencyLevel.TWO, ...);
// after
ConsistencyLevel cl = (cl == ConsistencyLevel.TWO || cl == ConsistencyLevel.THREE) ? ConsistencyLevel.QUORUM : cl;
barrier.await(cl, ...);
Defensive patterns

Strategy: validation

Validate before calling

private static final Set<ConsistencyLevel> SUPPORTED = EnumSet.of(ALL, EACH_QUORUM, LOCAL_QUORUM, QUORUM, ONE, NODE_LOCAL);
if (!SUPPORTED.contains(cl)) throw new IllegalArgumentException("unsupported CL for progress barrier: " + cl);

Try / catch

try { barrier.await(cl, writes, reads); }
catch (IllegalArgumentException e) { if (e.getMessage().startsWith("Progress barrier only supports")) barrier.await(mapToSupported(cl), writes, reads); else throw e; }

Prevention

When it happens

Trigger: Calling ProgressBarrier.await with a ConsistencyLevel such as TWO, THREE, LOCAL_ONE, ANY, or SERIAL.

Common situations: Reusing application-facing consistency levels in TCM/metadata barrier code that only accepts a subset; refactors that propagate a caller's CL straight into await without mapping; tests passing arbitrary CL enums.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/tcm/sequences/ProgressBarrier.java:208

                        waitFor = new WaitForAll(writes, reads);
                        break;
                    case EACH_QUORUM:
                        waitFor = new WaitForEachQuorum(writes, reads, metadata.directory);
                        break;
                    case LOCAL_QUORUM:
                        waitFor = new WaitForLocalQuorum(writes, reads, metadata.directory, location);
                        break;
                    case QUORUM:
                        waitFor = new WaitForQuorum(writes, reads);
                        break;
                    case ONE:
                        waitFor = new WaitForOne(writes, reads);
                        break;
                    case NODE_LOCAL:
                        waitFor = new WaitForNone();
                        break;
                    default:
                        throw new IllegalArgumentException("Progress barrier only supports ALL, EACH_QUORUM, LOCAL_QUORUM, QUORUM, ONE and NODE_LOCAL, but not " + cl);
                }

                maxWaitFor = Math.max(waitFor.waitFor(), maxWaitFor);
                waiters.add(waitFor);
            }
        }

        Set<InetAddressAndPort> collected = new HashSet<>();
        Set<WatermarkRequest> requests = new HashSet<>();
        for (InetAddressAndPort peer : superset)
            requests.add(new WatermarkRequest(peer, messagingService, waitFor));

        long start = Clock.Global.nanoTime();
        Retry deadline = Retry.untilElapsed(TimeUnit.MILLISECONDS.toNanos(TIMEOUT_MILLIS), TCMMetrics.instance.progressBarrierRetries, WAIT_STRATEGY);
        while (!deadline.hasExpired())
        {
            for (WatermarkRequest request : requests)
                request.retry();

View on GitHub (pinned to 88fd0f6a0e)