apache/cassandra · error · RepairException

Sync failed between and

Error message

Sync failed between %s and %s

What it means

A symmetric remote sync task (both replicas must stream to each other) failed between the coordinator and peer. tryFailure fails the task with a RepairException containing this message and the surrounding repair session terminates.

Solutions

  1. Inspect peer logs for streaming exceptions (StreamSession, StreamPlan).
  2. Confirm disk space and I/O health on both endpoints.
  3. Re-run nodetool repair after fixing the node; streams resume from scratch per session.
  4. Check network throughput/latency between nodes; increase streaming_socket_timeout_in_ms if streams time out on large datasets.
  5. Use nodetool netstats to see stuck or failed stream sessions.
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-flight: nodetool status (all UP), nodetool netstats (no failed streams),
// df -h both endpoints, check streaming_socket_timeout_in_ms

Try / catch

try {
    repairAsync(keyspace);
} catch (RuntimeException e) {
    if (e.getMessage().contains("Sync failed between")) {
        // inspect peer logs, verify disk/network, retry repair
    }
}

Prevention

When it happens

Trigger: syncComplete invoked with success=false when the bidirectional sync/stream between nodePair.coordinator and nodePair.peer did not finish successfully.

Common situations: Streaming failures from full disks, node crashes mid-stream, network timeouts, or a replica failing to respond to SyncRequest during standard (non-preview) repair.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/repair/SymmetricRemoteSyncTask.java:71

    {
        InetAddressAndPort local = ctx.broadcastAddressAndPort();
        SyncRequest request = new SyncRequest(desc, local, nodePair.coordinator, nodePair.peer, rangesToSync, previewKind, false);
        Preconditions.checkArgument(nodePair.coordinator.equals(request.src));
        String message = String.format("Forwarding streaming repair of %d ranges to %s (to be streamed with %s)", request.ranges.size(), request.src, request.dst);
        logger.info("{} {}", previewKind.logPrefix(desc.sessionId), message);
        Tracing.traceRepair(message);
        sendRequest(request, request.src);
    }

    public void syncComplete(boolean success, List<SessionSummary> summaries)
    {
        if (success)
        {
            trySuccess(stat.withSummaries(summaries));
        }
        else
        {
            tryFailure(RepairException.warn(desc, previewKind, String.format("Sync failed between %s and %s", nodePair.coordinator, nodePair.peer)));
        }
        finished();
    }

    @Override
    public String toString()
    {
        return "SymmetricRemoteSyncTask{" +
               "rangesToSync=" + rangesToSync +
               ", nodePair=" + nodePair +
               '}';
    }
}

View on GitHub (pinned to 88fd0f6a0e)