{"record":{"id":"ce2427b82e942fe1","repo":"apache/cassandra","slug":"route-index-is-only-allowed-for-accord-journal-tab-ce2427","errorCode":null,"errorMessage":"Route index is only allowed for accord journal table, and on the record/user_value columns; given %s and columns %s","messagePattern":"Route index is only allowed for accord journal table, and on the record/user_value columns; given (.+?) and columns (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/index/accord/RouteJournalIndex.java","lineNumber":156,"sourceCode":"        return id.type == JournalKey.Type.COMMAND_DIFF && allowed(id.id);\n    }\n\n    public static boolean allowed(TxnId id)\n    {\n        return id.is(Range);\n    }\n\n    private static void validateTargets(ColumnFamilyStore baseCfs, IndexMetadata indexMetadata)\n    {\n        // this contains 2 columns....\n        if (!SchemaConstants.ACCORD_KEYSPACE_NAME.equals(baseCfs.getKeyspaceName()))\n            throw new IllegalArgumentException(\"Route index is only allowed for accord journal table; given \" + baseCfs.metadata());\n        if (!AccordKeyspace.JOURNAL.equals(baseCfs.name))\n            throw new IllegalArgumentException(\"Route index is only allowed for accord journal table; given \" + baseCfs.metadata());\n        Set<String> columns = Splitter.on(',').trimResults().omitEmptyStrings().splitToStream(indexMetadata.options.get(\"target\")).collect(Collectors.toSet());\n        Set<String> expected = Set.of(\"record\", \"user_version\");\n        if (!expected.equals(columns))\n            throw new IllegalArgumentException(\"Route index is only allowed for accord journal table, and on the record/user_value columns; given \" + baseCfs.metadata() + \" and columns \" + columns);\n    }\n\n    public IndexMetrics indexMetrics()\n    {\n        return indexMetrics;\n    }\n\n    public RegisterStatus registerStatus()\n    {\n        return registerStatus;\n    }\n\n    public ColumnFamilyStore baseCfs()\n    {\n        return baseCfs;\n    }\n\n    @Override","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/index/accord/RouteJournalIndex.java#L138-L174","documentation":"validateTargets throws this when the index is on accord.journal but the target columns are not exactly {record, user_version}. The comma-separated 'target' option is split, trimmed, and compared as a set against the required two columns; any extra, missing, or misspelled column fails.","triggerScenarios":"RouteJournalIndex created with target options other than 'record,user_version' — e.g. only 'record', extra columns, different column names, or a single-column target.","commonSituations":"Hand-writing the CREATE INDEX target string; changing journal schema assumptions; automation that generates target lists from table columns.","solutions":["Set the target exactly to (record, user_version)","Drop and recreate the index with both columns","Inspect the existing index with DESCRIBE and correct the columns list"],"exampleFix":"// before\nCREATE CUSTOM INDEX route_idx ON accord.journal (record) USING 'org.apache.cassandra.index.accord.RouteJournalIndex';\n// after\nCREATE CUSTOM INDEX route_idx ON accord.journal (record, user_version) USING 'org.apache.cassandra.index.accord.RouteJournalIndex';","handlingStrategy":"validation","validationCode":"Set<String> cols = new HashSet<>(Arrays.asList(target.split(\",\")));\nif (!Set.of(\"record\", \"user_version\").equals(cols)) throw new IllegalStateException(\"RouteJournalIndex requires target columns record,user_version, got \" + cols);","typeGuard":null,"tryCatchPattern":"try { validateTargets(baseCfs, indexMetadata); } catch (IllegalArgumentException e) { /* recreate index with record,user_version */ }","preventionTips":["Copy the canonical DDL for accord.journal route index verbatim","Validate index target columns in CI before applying schema changes"],"tags":["cassandra","accord","index","illegal-argument"],"backgroundTag":"invalid-argument-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"}