{"record":{"id":"a8fa73af46ccd57b","repo":"apache/cassandra","slug":"cf-s-was-dropped-during-streaming-a8fa73","errorCode":null,"errorMessage":"CF %s was dropped during streaming","messagePattern":"CF (.+?) was dropped during streaming","errorType":"exception","errorClass":"StreamReceiveException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/streaming/messages/IncomingStreamMessage.java","lineNumber":44,"sourceCode":"import org.apache.cassandra.streaming.StreamManager;\nimport org.apache.cassandra.streaming.StreamReceiveException;\nimport org.apache.cassandra.streaming.StreamSession;\nimport org.apache.cassandra.streaming.StreamingChannel;\nimport org.apache.cassandra.streaming.StreamingDataOutputPlus;\n\npublic class IncomingStreamMessage extends StreamMessage\n{\n    public static Serializer<IncomingStreamMessage> serializer = new Serializer<IncomingStreamMessage>()\n    {\n        public IncomingStreamMessage deserialize(DataInputPlus input, int version) throws IOException\n        {\n            StreamMessageHeader header = StreamMessageHeader.serializer.deserialize(input, version);\n            StreamSession session = StreamManager.instance.findSession(header.sender, header.planId, header.sessionIndex, header.sendByFollower);\n            if (session == null)\n                throw new IllegalStateException(String.format(\"unknown stream session: %s - %d\", header.planId, header.sessionIndex));\n            ColumnFamilyStore cfs = ColumnFamilyStore.getIfExists(header.tableId);\n            if (cfs == null)\n                throw new StreamReceiveException(session, \"CF \" + header.tableId + \" was dropped during streaming\");\n\n            try\n            {\n                IncomingStream incomingData = cfs.getStreamManager().prepareIncomingStream(session, header);\n                incomingData.read(input, version);\n\n                return new IncomingStreamMessage(incomingData, header);\n            }\n            catch (Throwable t)\n            {\n                if (t instanceof StreamReceiveException)\n                    throw (StreamReceiveException) t;\n                // make sure to wrap so the caller always has access to the session to call onError\n                throw new StreamReceiveException(session, t);\n            }\n        }\n\n        public void serialize(IncomingStreamMessage message, StreamingDataOutputPlus out, int version, StreamSession session)","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/streaming/messages/IncomingStreamMessage.java#L26-L62","documentation":"During IncomingStreamMessage deserialization, after finding the stream session the receiver resolves the target table by tableId via ColumnFamilyStore.getIfExists. If the column family no longer exists it throws StreamReceiveException with this message: the table was dropped while its data was still being streamed, so the incoming stream has nowhere to land.","triggerScenarios":"A schema change (DROP TABLE / DROP KEYSPACE) executed on the receiving node while a peer is actively streaming sstables for that tableId; the stream session exists but its target CF was removed concurrently.","commonSituations":"Running DROP TABLE or schema migrations concurrently with repair/bootstrap streaming; a node joining while a developer drops unused tables; cqlsh-driven schema cleanup racing an ongoing decommission/rebuild stream.","solutions":["Wait for in-flight streaming operations to complete before dropping tables, or cancel/let the stream session fail and re-run streaming afterwards","If the drop was intentional, the failure is benign: verify the failed session is closed and no retries keep streaming to the dropped table","If the drop was unintentional, restore the table schema (recreate table / restore schema from backup) and re-run repair or the streaming operation","Check schema agreement between nodes (nodetool describecluster) to rule out schema disagreement causing one node to see the table as dropped"],"exampleFix":"// before\nDROP TABLE ks.t;            // while bootstrap streaming t is in flight\n// after\nnodetool netstats           // confirm streaming finished first\nDROP TABLE ks.t;","handlingStrategy":"try-catch","validationCode":"ColumnFamilyStore cfs = ColumnFamilyStore.getIfExists(header.tableId);\nif (cfs == null) { logger.warn(\"table {} dropped during streaming; aborting receive\", header.tableId); abortSession(session); return; }","typeGuard":null,"tryCatchPattern":"try { receiveStream(header, input); }\ncatch (StreamReceiveException e) {\n    logger.warn(\"stream aborted: {}\", e.getMessage()); // benign if drop was intentional\n}","preventionTips":["Do not DROP TABLE/KEYSPACE while repairs, rebuilds, or bootstraps are running","Check nodetool netstats / system_logs for active streaming before schema changes","Verify schema agreement across the cluster before and after schema migrations"],"tags":["streaming","schema","table-dropped"],"backgroundTag":"schema-validation-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}