{"record":{"id":"9665d11fc52b0ada","repo":"apache/cassandra","slug":"unknown-kind-kind","errorCode":null,"errorMessage":"Unknown kind: {kind}","messagePattern":"Unknown kind: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/accord/txn/TxnData.java","lineNumber":82,"sourceCode":"        TxnDataNameKind(byte value)\n        {\n            this.value = value;\n        }\n\n        public static TxnDataNameKind from(byte b)\n        {\n            switch (b)\n            {\n                case 0:\n                    return USER;\n                case 1:\n                    return RETURNING;\n                case 2:\n                    return AUTO_READ;\n                case 3:\n                    return CAS_READ;\n                default:\n                    throw new IllegalArgumentException(\"Unknown kind: \" + b);\n            }\n        }\n    }\n\n    public static int txnDataName(TxnDataNameKind kind, int index)\n    {\n        requireArgument(index >= 0 && index <= TXN_DATA_NAME_INDEX_MAX);\n        int kindInt = (int)(((long)kind.value) << TXN_DATA_NAME_INDEX_BITS);\n        return kindInt | index;\n    }\n\n    public static int txnDataName(TxnDataNameKind kind)\n    {\n        return txnDataName(kind, 0);\n    }\n\n    public static TxnDataNameKind txnDataNameKind(int txnDataName)\n    {","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/accord/txn/TxnData.java#L64-L100","documentation":"TxnData.Kind.from(byte) decodes the one-byte discriminator for transaction data kinds: 0=RETURNING? (per switch: 0/1→RETURNING variants), 2=AUTO_READ, 3=CAS_READ. Any other byte indicates an unknown or future-version kind and throws IllegalArgumentException. This is a deserialization guard against peers writing kinds this build does not understand.","triggerScenarios":"Calling TxnData.Kind.from(b) with a byte outside {0,1,2,3}, typically while deserializing a transaction data payload from a newer build that added a kind.","commonSituations":"Rolling upgrade where a new TxnData kind was introduced; corrupted transport payload; tests crafting out-of-range kind bytes.","solutions":["Upgrade this node to a build that knows the new kind.","Verify sender and receiver builds match before exchanging Accord traffic.","Add the missing kind constant and mapping before enabling traffic from upgraded peers."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"byte b = readKindByte(payload);\nif (b < 0 || b > 3) throw new IllegalArgumentException(\"Unknown TxnData kind byte: \" + b);","typeGuard":null,"tryCatchPattern":"try {\n    TxnData.Kind kind = TxnData.Kind.from(b);\n} catch (IllegalArgumentException e) {\n    logger.error(\"Unknown TxnData kind {} from peer\", b, e);\n    dropAndRequestResync(peer);\n}","preventionTips":["Range-check discriminator bytes before decoding","Upgrade all nodes before introducing new TxnData kinds","Enable payload integrity checks to catch corruption"],"tags":["accord","serialization","transactions"],"backgroundTag":"invalid-enum-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}