apache/cassandra · warning

[{}] Received {} from {} containing ranges {} outside valid

Error message

[{}] Received {} from {} containing ranges {} outside valid ranges {}

What it means

OwnedRanges.validateRangeRequest checks incoming streaming/stream-request ranges against the node's currently owned ranges. When some requested ranges fall outside what this node owns, it increments totalOpsForInvalidToken, logs this warning with the request id, type, source, unowned and owned ranges, and returns false so the request is rejected. It protects against streaming data the node is not responsible for (e.g. after topology changes).

Source

Thrown at src/java/org/apache/cassandra/dht/OwnedRanges.java:78

     * If either option is enabled and we do detect unowned ranges in the request, we increment a metric then take further
     * action depending on the config.
     *
     * @param requestedRanges the set of token ranges contained in a request from a peer
     * @param requestId an identifier for the peer request, to be used in logging (e.g. Stream or Repair Session #)
     * @param requestType description of the request type, to be used in logging (e.g. "prepare request" or "validation")
     * @param from the originator of the request
     * @return true if the request should be accepted (either because no checking was performed, invalid ranges were d
     *         identified but only the logging action is enabled, or because all request ranges were valid. Otherwise,
     *         returns false to indicate the request should be rejected.
     */
    public boolean validateRangeRequest(Collection<Range<Token>> requestedRanges, String requestId, String requestType, InetAddressAndPort from)
    {
        Collection<Range<Token>> unownedRanges = testRanges(requestedRanges);

        if (!unownedRanges.isEmpty())
        {
            StorageMetrics.totalOpsForInvalidToken.inc();
            logger.warn("[{}] Received {} from {} containing ranges {} outside valid ranges {}",
                        requestId,
                        requestType,
                        from,
                        unownedRanges,
                        ownedRanges);
            return false;
        }
        return true;
    }

    /**
     * Takes a collection of ranges and returns ranges from that collection that are not covered by the this node's owned ranges.
     *
     * This normalizes the range collections internally, so:
     * a) be cautious about using this in any hot path
     * b) any returned ranges may not be identical to those present. That is, the returned values are post-normalization.
     *
     * e.g Given two collections:

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Ensure the ring has converged: run nodetool status on all nodes and confirm consistent token ownership.
  2. Let the originator recompute its stream plan after schema/gossip settle (restart streaming).
  3. Check for in-progress bootstrap/decommission operations and finish them before streaming.
  4. If it recurs without topology changes, verify cluster-wide versions and clear any stale pending ranges (nodetool netstats, system.peers sanity).
Defensive patterns

Strategy: retry

Prevention

When it happens

Trigger: A stream request (processStreamRequests) arrives from a peer referencing ranges the local node no longer owns — typically stale requests issued before/during a ring change (bootstrap/decommission/move) or from a node with outdated ring metadata.

Common situations: Concurrent topology operations where a sender computed ranges from an old token ring; mixed ring views after a failed gossip convergence; replayed or queued stream requests following a move; operators running manual stream plans with wrong ranges.

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/f5dd28a62dd256f8. Report an issue: GitHub.