{"record":{"id":"6d0097c9cb5fa9df","repo":"MyCATApache/Mycat-Server","slug":"crc32slot-s-properties-does-not-match-schema-tabl","errorCode":null,"errorMessage":"crc32slot_%s.properties does not match schema table dataNode.","messagePattern":"crc32slot_(.+?)\\.properties does not match schema table dataNode\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/mycat/migrate/MigrateUtils.java","lineNumber":65,"sourceCode":"        for (int i = 0; i < integerListMap.size(); i++) {\n\n            List<Range> rangeList = integerListMap.get(i);\n            int needMoveNum = getCurTotalSize(rangeList) - newSlotPerNode;\n            List<Range> allMoveList = getPartAndRemove(rangeList, needMoveNum);\n            for (int i1 = 0; i1 < newDataNodes.size(); i1++) {\n                String newDataNode = newDataNodes.get(i1);\n                if (allMoveList.size() == 0)\n                    break;\n                List<MigrateTask> curRangeList = newNodeTask.get(newDataNode);\n                if (curRangeList == null)\n                    curRangeList = new ArrayList<>();\n                int hasSlots = getCurTotalSizeForTask(curRangeList);\n                int needMove = (i1 == 0) ? newSlotPerNode - hasSlots + gb : newSlotPerNode - hasSlots;\n                if (needMove > 0) {\n                    List<Range> moveList = getPartAndRemove(allMoveList, needMove);\n                    MigrateTask task = new MigrateTask();\n                    if (i >= oldDataNodes.size()) {\n                        throw new RuntimeException(String.format(\"crc32slot_%s.properties does not match schema table dataNode.\", table.toUpperCase()));\n                    }\n                    task.setFrom(oldDataNodes.get(i));\n                    task.setTo(newDataNode);\n                    task.setTable(table);\n                    task.setSlots(moveList);\n                    curRangeList.add(task);\n                    newNodeTask.put(newDataNode, curRangeList);\n                }\n            }\n\n            if (allMoveList.size() > 0) {\n                throw new RuntimeException(\"some slot has not moved to\");\n            }\n        }\n        return newNodeTask;\n    }\n\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/migrate/MigrateUtils.java#L47-L83","documentation":"balanceExpand redistributes slots of crc32slot_%s.properties across new data nodes. When it needs to take a task from oldDataNodes index i but i has run past the list, the rule file's dataNode list and the schema's table dataNodes disagree, so it throws this formatted error naming the table. This is a consistency guard against a stale/incomplete slot rule file.","triggerScenarios":"crc32slot_<TABLE>.properties references fewer dataNodes than schema.xml defines for the table; the rule file was edited or copied from another table; nodes were added to schema.xml without regenerating the rule file; case mismatch on the table name used to locate the file.","commonSituations":"Manual edits to conf/crc32slot files after scaling out; migration run against a schema whose rule file was generated before adding dataNodes; copying rule files between environments.","solutions":["Regenerate crc32slot_<TABLE>.properties to match the current dataNode list in schema.xml (rebuild the rule file or use MyCAT's rule regeneration tooling).","Ensure table name casing matches: the error uses table.toUpperCase(), verify the properties file uses the same naming.","Align schema.xml dataNodes with the from/to nodes in the rule file before rerunning balanceExpand.","Back up and hand-merge the rule file only if regeneration is impossible, keeping dataNode count equal on both sides."],"exampleFix":"// before\nif (i >= oldDataNodes.size()) {\n    throw new RuntimeException(String.format(\"crc32slot_%s.properties does not match schema table dataNode.\", table.toUpperCase()));\n}\n// after\n// regenerate the rule file first:\n// java -cp mycat.jar io.mycat.util.RegenCrc32SlotRule <schema> <table>\n// then rerun balanceExpand with matching dataNodes","handlingStrategy":"validation","validationCode":"// compare rule file dataNodes vs schema.xml before expansion\nProperties rule = loadProperties(\"crc32slot_\" + table.toUpperCase() + \".properties\");\nSet<String> ruleNodes = rule.stringPropertyNames().stream().map(k -> k.split(\"=\")[0]).collect(toSet());\nSet<String> schemaNodes = getDataNodesFromSchemaXml(table);\nif (!ruleNodes.containsAll(schemaNodes)) throw new IllegalStateException(\"rule file out of sync with schema.xml\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-edit crc32slot files; regenerate them","Keep table name casing consistent (rule file uses uppercase table names)","Re-run rule generation after every schema.xml dataNode change","Diff rule files against a known-good environment before expansion"],"tags":["migration","sharding","config-mismatch","crc32slot"],"backgroundTag":"schema-validation-failed","analyzedSha":"65f8d8beb752f935752f2a0eec0ab017facab9ef","analyzedAt":"2026-09-11T00:12:21.696Z","contentChangedAt":"2026-09-11T00:12:21.696Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}