{"record":{"id":"55815594512ab60b","repo":"apache/cassandra","slug":"overlapping-verb-ids-are-not-allowed","errorCode":null,"errorMessage":"Overlapping verb ids are not allowed","messagePattern":"Overlapping verb ids are not allowed","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/net/Verb.java","lineNumber":617,"sourceCode":"        int minCustom = Integer.MAX_VALUE;\n        for (Verb v : verbs)\n        {\n            switch (v.kind)\n            {\n                case NORMAL:\n                    max = Math.max(v.id, max);\n                    break;\n                case CUSTOM:\n                    minCustom = Math.min(v.id, minCustom);\n                    break;\n                default:\n                    throw new AssertionError(\"Unsupported Verb Kind: \" + v.kind + \" for verb \" + v);\n            }\n        }\n        minCustomId = minCustom;\n\n        if (minCustom <= max)\n            throw new IllegalStateException(\"Overlapping verb ids are not allowed\");\n\n        Verb[] idMap = new Verb[max + 1];\n        int customCount = minCustom < Integer.MAX_VALUE ? CUSTOM_VERB_START - minCustom : 0;\n        Verb[] customIdMap = new Verb[customCount + 1];\n        for (Verb v : verbs)\n        {\n            switch (v.kind)\n            {\n                case NORMAL:\n                    if (idMap[v.id] != null)\n                        throw new IllegalArgumentException(\"cannot have two verbs that map to the same id: \" + v + \" and \" + idMap[v.id]);\n                    idMap[v.id] = v;\n                    break;\n                case CUSTOM:\n                    int relativeId = idForCustomVerb(v.id);\n                    if (customIdMap[relativeId] != null)\n                        throw new IllegalArgumentException(\"cannot have two custom verbs that map to the same id: \" + v + \" and \" + customIdMap[relativeId]);\n                    customIdMap[relativeId] = v;","sourceCodeStart":599,"sourceCodeEnd":635,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/net/Verb.java#L599-L635","documentation":"During the static initialization of Cassandra's internode messaging Verb registry, all NORMAL verb ids must fit below CUSTOM_VERB_START and all CUSTOM verb ids must sit at or above the minimum custom id. If the lowest custom verb id is <= the highest normal verb id (max), the two id spaces overlap and ids could be ambiguous on the wire, so startup fails with IllegalStateException.","triggerScenarios":"Adding a new custom Verb whose enum-declared id falls into (or below) the range occupied by NORMAL verb ids, or lowering CUSTOM_VERB_START / renumbering verbs so minCustom <= max, then booting the node (class-init of Verb).","commonSituations":"Contributing a patch or applying a custom messaging patch (e.g. vendor extensions) that assigns a verb id already used by core verbs; rebasing a fork across a Cassandra version where verb id ranges shifted.","solutions":["Renumber the offending custom verb id to a value strictly greater than the max NORMAL verb id (and >= CUSTOM_VERB_START).","Rebuild and inspect Verb.mappings / the enum declarations to confirm NORMAL and CUSTOM id ranges are disjoint.","If merging branches, diff Verb.java and resolve duplicate/shifted verb ids before deploying."],"exampleFix":"// before\nMAPPING_156(120, MessageCategory.MISC, custom, \"CUSTOM_X\") // collides with normal range\n// after\nMAPPING_156(3000, MessageCategory.MISC, custom, \"CUSTOM_X\") // inside the custom id range","handlingStrategy":"validation","validationCode":"// before shipping a new Verb\nint id = myNewVerb.id;\nassert id >= CUSTOM_VERB_START || id <= maxNormalVerbId(); // must lie inside the custom range\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a central registry/comment of allocated custom verb ids","Add a unit test that loads the Verb class to fail fast in CI","Rebase Verb.java carefully across versions and re-check id ranges"],"tags":["startup","messaging","configuration"],"backgroundTag":"conflicting-config-options","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"}