apache/cassandra · warning · RepairException

(dynamic, caller-supplied message) RepairException.warn…

Error message

(dynamic, caller-supplied message) RepairException.warn factory

What it means

RepairException.warn(desc, previewKind, message) is a factory creating a RepairException marked as a 'warn' severity increment repair failure. The message is fully caller-supplied; typical contents include repair session failures, unrepaired-range mismatches, timeouts during validation/sync stages. It is usually surfaced to `nodetool repair` clients or logged by the repair coordinator.

Solutions

  1. Read the caller-supplied message: it names the repair job desc and the specific stage that failed.
  2. Re-run `nodetool repair` on the affected keyspace/ranges once all replica nodes are up and not overloaded.
  3. Check the logs of every replica in the repaired range for the underlying cause (GC pauses, dropped messages, timeouts).
  4. If preview reported inconsistencies, run a full (non-preview) repair to reconcile the replicas.
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure all replicas are UP before repairing
Set<InetAddressAndPort> down = endpoints.stream().filter(ep -> !Gossiper.instance.isAlive(ep)).collect(Collectors.toSet());
if (!down.isEmpty()) throw new IllegalArgumentException("Refusing repair, nodes down: " + down);

Try / catch

try { repairService.repair(ks, tables, options); } catch (RepairException e) { if (RepairException.shouldWarn(e)) logger.warn("Repair warning: {}", e.getMessage()); else throw e; }

Prevention

When it happens

Trigger: Any repair job stage (ValidationTask, SyncTask, RepairSession) that calls RepairException.warn with a session-specific message when a repair step fails in a way deemed non-fatal/warning-worthy, e.g. a node stopped responding during validation or preview mismatch found during `nodetool repair --preview`.

Common situations: Preview repair (`nodetool repair --preview`) detecting inconsistencies between replicas; incremental repair sessions hitting timeouts; anti-compaction or sync failures while a node is overloaded or down.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/exceptions/RepairException.java:48

    private final boolean shouldLogWarn;

    private RepairException(@Nullable RepairJobDesc desc, PreviewKind previewKind, String message, boolean shouldLogWarn)
    {
        this((desc == null ? "" : desc.toString(previewKind != null ? previewKind : PreviewKind.NONE)) + ' ' + message, shouldLogWarn);
    }

    private RepairException(String msg, boolean shouldLogWarn)
    {
        super(msg);
        this.shouldLogWarn = shouldLogWarn;
    }

    public static RepairException error(@Nullable RepairJobDesc desc, PreviewKind previewKind, String message)
    {
        return new RepairException(desc, previewKind, message, false);
    }

    public static RepairException warn(@Nullable RepairJobDesc desc, PreviewKind previewKind, String message)
    {
        return new RepairException(desc, previewKind, message, true);
    }

    public static RepairException warn(String message)
    {
        return new RepairException(message, true);
    }

    public static boolean shouldWarn(Throwable throwable)
    {
        return throwable instanceof RepairException && ((RepairException)throwable).shouldLogWarn;
    }
}

View on GitHub (pinned to 88fd0f6a0e)