apache/cassandra · warning

[Stream {}] Error while reading partition {} from stream on

Error message

[Stream {}] Error while reading partition {} from stream on ks='{}' and table='{}'.

What it means

CassandraCompressedStreamReader.read() receives a compressed sstable stream from a peer and deserializes partitions into a writer. Any throwable during reading/deserialization (corrupt compressed chunks, network truncation, deserialization failures) is logged with the stream plan ID and the partition key read so far, the writer is aborted to clean up partial files, and the exception is rethrown to fail the stream session.

Source

Thrown at src/java/org/apache/cassandra/db/streaming/CassandraCompressedStreamReader.java:114

                while (in.getBytesRead() < sectionLength)
                {
                    writePartition(deserializer, writer);
                    // when compressed, report total bytes of compressed chunks read since remoteFile.size is the sum of chunks transferred
                    long bytesRead = cis.chunkBytesRead();
                    long bytesDelta = bytesRead - lastBytesRead;
                    lastBytesRead = bytesRead;
                    session.progress(sectionName, ProgressInfo.Direction.IN, bytesRead, bytesDelta, totalSize);
                }
                assert in.getBytesRead() == sectionLength;
            }
            logger.info("[Stream #{}] Finished receiving file #{} from {} readBytes = {}, totalSize = {}", session.planId(), fileSeqNum,
                         session.peer, FBUtilities.prettyPrintMemory(cis.chunkBytesRead()), FBUtilities.prettyPrintMemory(totalSize));
            return writer;
        }
        catch (Throwable e)
        {
            Object partitionKey = deserializer != null ? deserializer.partitionKey() : "";
            logger.warn("[Stream {}] Error while reading partition {} from stream on ks='{}' and table='{}'.",
                        session.planId(), partitionKey, cfs.getKeyspaceName(), cfs.getTableName());
            if (writer != null)
                e = writer.abort(e);
            throw e;
        }
    }

    @Override
    protected long totalSize()
    {
        return compressionInfo.getTotalSize();
    }
}

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Rerun the streaming/repair (nodetool repair or restart streaming) once the network is healthy — streaming retries rebuild the file
  2. Check both nodes' logs and system.log for the root cause exception (corruption vs network)
  3. Verify disk health (dmesg, nodetool tpstats, filesystem errors) on receiver and sender
  4. Ensure cluster nodes are on a compatible Cassandra version before streaming across a rolling upgrade
Defensive patterns

Strategy: retry

Validate before calling

// before streaming: verify disk space and network
// df -h on data dirs; ping/iperf between peers
// confirm matching Cassandra versions: nodetool version on both nodes

Try / catch

try {
    reader.read(...);
} catch (Throwable t) {
    logger.warn("Stream read failed for plan {} partition {}", planId, partitionKey, t);
    // retry via repair / restart streaming session
}

Prevention

When it happens

Trigger: read() hits a Throwable while decompressing/deserializing a partition from the peer's stream; the partition key from the deserializer (or empty if deserialization failed before a key was set) is included in the warning.

Common situations: Network interruption or checksum corruption during streaming; disk issues on the receiving node; version/serialization mismatch between nodes; corrupted compressed chunk cache on the sender.

Related errors


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