{"record":{"id":"cc2d957091eb3ecf","repo":"apache/cassandra","slug":"stream-error-while-reading-partition-from","errorCode":null,"errorMessage":"[Stream {}] Error while reading partition {} from stream on ks='{}' and table='{}'.","messagePattern":"\\[Stream (.+?)\\] Error while reading partition (.+?) from stream on ks='(.+?)' and table='(.+?)'\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/streaming/CassandraCompressedStreamReader.java","lineNumber":114,"sourceCode":"                while (in.getBytesRead() < sectionLength)\n                {\n                    writePartition(deserializer, writer);\n                    // when compressed, report total bytes of compressed chunks read since remoteFile.size is the sum of chunks transferred\n                    long bytesRead = cis.chunkBytesRead();\n                    long bytesDelta = bytesRead - lastBytesRead;\n                    lastBytesRead = bytesRead;\n                    session.progress(sectionName, ProgressInfo.Direction.IN, bytesRead, bytesDelta, totalSize);\n                }\n                assert in.getBytesRead() == sectionLength;\n            }\n            logger.info(\"[Stream #{}] Finished receiving file #{} from {} readBytes = {}, totalSize = {}\", session.planId(), fileSeqNum,\n                         session.peer, FBUtilities.prettyPrintMemory(cis.chunkBytesRead()), FBUtilities.prettyPrintMemory(totalSize));\n            return writer;\n        }\n        catch (Throwable e)\n        {\n            Object partitionKey = deserializer != null ? deserializer.partitionKey() : \"\";\n            logger.warn(\"[Stream {}] Error while reading partition {} from stream on ks='{}' and table='{}'.\",\n                        session.planId(), partitionKey, cfs.getKeyspaceName(), cfs.getTableName());\n            if (writer != null)\n                e = writer.abort(e);\n            throw e;\n        }\n    }\n\n    @Override\n    protected long totalSize()\n    {\n        return compressionInfo.getTotalSize();\n    }\n}\n","sourceCodeStart":96,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/streaming/CassandraCompressedStreamReader.java#L96-L128","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Rerun the streaming/repair (nodetool repair or restart streaming) once the network is healthy — streaming retries rebuild the file","Check both nodes' logs and system.log for the root cause exception (corruption vs network)","Verify disk health (dmesg, nodetool tpstats, filesystem errors) on receiver and sender","Ensure cluster nodes are on a compatible Cassandra version before streaming across a rolling upgrade"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// before streaming: verify disk space and network\n// df -h on data dirs; ping/iperf between peers\n// confirm matching Cassandra versions: nodetool version on both nodes","typeGuard":null,"tryCatchPattern":"try {\n    reader.read(...);\n} catch (Throwable t) {\n    logger.warn(\"Stream read failed for plan {} partition {}\", planId, partitionKey, t);\n    // retry via repair / restart streaming session\n}","preventionTips":["Monitor network stability between nodes during streaming","Keep cluster versions uniform or within streaming compatibility","Watch disk health and free space on receiving nodes","Rerun failed repairs; streaming is idempotent at file granularity"],"tags":["streaming","serialization","network","data-corruption"],"backgroundTag":"stream-read-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}