apache/cassandra · error · IllegalArgumentException

cannot repair paxos in a preview repair

Error message

cannot repair paxos in a preview repair

What it means

ActiveRepairService.submitRepairSession refuses to create a repair session that combines Paxos repair with a preview repair. Preview repairs (irange/repairedAt previews) only estimate what a repair would do and never commit Merkle trees, so running a Paxos consistency repair in preview mode is meaningless and rejected up front with IllegalArgumentException.

Source

Thrown at src/java/org/apache/cassandra/service/ActiveRepairService.java:476

                                             boolean excludedDeadNodes,
                                             String keyspace,
                                             RepairParallelism parallelismDegree,
                                             boolean allReplicas,
                                             boolean isIncremental,
                                             boolean pullRepair,
                                             PreviewKind previewKind,
                                             boolean optimiseStreams,
                                             boolean repairData,
                                             boolean repairPaxos,
                                             boolean dontPurgeTombstones,
                                             boolean repairAccord,
                                             boolean permitNoQuorum,
                                             ExecutorPlus executor,
                                             Scheduler validationScheduler,
                                             String... cfnames)
    {
        if (repairPaxos && previewKind != PreviewKind.NONE)
            throw new IllegalArgumentException("cannot repair paxos in a preview repair");

        if (range.endpoints.isEmpty())
            return null;

        if (cfnames.length == 0)
            return null;

        final RepairSession session = new RepairSession(ctx, validationScheduler, parentRepairSession,
                                                        range, excludedDeadNodes, keyspace,
                                                        parallelismDegree, allReplicas, isIncremental, pullRepair,
                                                        previewKind, optimiseStreams, repairData, repairPaxos,
                                                        dontPurgeTombstones, repairAccord, permitNoQuorum, cfnames);
        repairs.getIfPresent(parentRepairSession).register(session.state);

        sessions.put(session.getId(), session);
        // register listeners
        registerOnFdAndGossip(session);

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Remove the preview option (use PreviewKind.NONE) so the Paxos repair can actually run
  2. Remove the --repair-paxos flag when performing a preview repair
  3. If the goal is Paxos consistency, run a full (non-preview) repair: nodetool repair --paxos-only or a normal repair without preview flags

Example fix

// before
storageService.repair(keyspace, options-with-preview-and-paxos); // throws
// after
Map<String,String> opts = new HashMap<>();
opts.put(RepairOption.PARALLELISM_KEY, "parallel");
opts.put(RepairOption.PAXOS_ONLY_KEY, "true"); // no preview
storageService.repair(keyspace, opts);
Defensive patterns

Strategy: validation

Validate before calling

if (opts.paxosOnly || opts.repairPaxos) {
    if (opts.preview || opts.previewKind !== 'NONE')
        throw new Error('preview and paxos repair are mutually exclusive');
}

Try / catch

try { repairSession(..., /*repairPaxos*/ true, /*previewKind*/ PreviewKind.NONE, ...); }
catch (IllegalArgumentException e) { log.error("preview+paxos conflict", e); }

Prevention

When it happens

Trigger: Calling RepairSession/submitRepairSession with repairPaxos=true while previewKind != PreviewKind.NONE, e.g. running nodetool repair with --repair-paxos together with --preview, or invoking the JMX/API repair path with both options set.

Common situations: Operators scripting nodetool repair combining flags like -pr/--repair-paxos with preview or incremental-repair-adjacent options; automated repair schedulers that set preview kind globally without clearing paxos repair.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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