apache/cassandra · error · IllegalArgumentException

Cannot specify a repair as both paxos only and accord only

Error message

Cannot specify a repair as both paxos only and accord only

What it means

RepairCoordinator.validate rejects repair options that set both paxos-only and accord-only modes, since a single repair cannot target both consensus protocols exclusively. The request is rejected with IllegalArgumentException before any repair work starts.

Source

Thrown at src/java/org/apache/cassandra/repair/RepairCoordinator.java:296

        try
        {
            runMayThrow();
        }
        catch (SkipRepairException e)
        {
            skip(e.getMessage());
        }
        catch (Throwable e)
        {
            notifyError(e);
            fail(e.getMessage());
        }
    }

    private static void validate(RepairOption options, List<ColumnFamilyStore> columnFamilies)
    {
        if (options.paxosOnly() && options.accordOnly())
            throw new IllegalArgumentException("Cannot specify a repair as both paxos only and accord only");

        for (ColumnFamilyStore cfs : columnFamilies)
        {
            TableMetadata metadata = cfs.metadata();
            if (options.paxosOnly() && !metadata.supportsPaxosOperations())
                throw new IllegalArgumentException(String.format("Cannot run paxos only repair on %s.%s, which isn't configured for paxos operations", cfs.keyspace.getName(), cfs.name));

            if (options.accordOnly() && !metadata.requiresAccordSupport())
                throw new IllegalArgumentException(String.format("Cannot run accord only repair on %s.%s, which isn't configured for accord operations", cfs.keyspace.getName(), cfs.name));
        }
    }

    private void runMayThrow() throws Throwable
    {
        state.phase.setup();
        ctx.repair().recordRepairStatus(state.cmd, ParentRepairStatus.IN_PROGRESS, ImmutableList.of());

        List<ColumnFamilyStore> columnFamilies = getColumnFamilies();

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Set only one of paxos-only or accord-only in the repair request.
  2. Fix the calling script/tooling to make the two options mutually exclusive.
  3. If you need both protocol scopes, issue two separate repair calls.

Example fix

// before
opts.put(RepairOption.PAXOS_ONLY, "true"); opts.put(RepairOption.ACCORD_ONLY, "true");
// after
opts.put(RepairOption.PAXOS_ONLY, "true"); // or ACCORD_ONLY, not both
Defensive patterns

Strategy: validation

Validate before calling

if (paxosOnly && accordOnly) throw new IllegalArgumentException("choose either --paxos-only or --accord-only");

Try / catch

try { repairAsync(ks, options); } catch (IllegalArgumentException e) { usage("Invalid repair options: " + e.getMessage()); }

Prevention

When it happens

Trigger: Calling repair (nodetool/JMX/StorageService.repairAsync) with RepairOption where both PaxosOnly and AccordOnly flags are set to true.

Common situations: Scripting repair calls that concatenate flags (e.g. --paxos-only --accord-only) from separate config variables without checking for overlap.

Understand the failure class

Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.

Related errors


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