{"record":{"id":"7e35c199a90add30","repo":"apache/rocketmq","slug":"cidall-is-null-or-cidall-empty","errorCode":null,"errorMessage":"cidAll is null or cidAll empty","messagePattern":"cidAll is null or cidAll empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"broker/src/main/java/org/apache/rocketmq/broker/processor/QueryAssignmentProcessor.java","lineNumber":286,"sourceCode":"                //make sure each cid is assigned\n                allocateResult = allocate(consumerGroup, clientId, mqAll, cidAll);\n            }\n        }\n\n        return allocateResult;\n    }\n\n    private List<MessageQueue> allocate(String consumerGroup, String currentCID, List<MessageQueue> mqAll,\n        List<String> cidAll) {\n        if (StringUtils.isBlank(currentCID)) {\n            throw new IllegalArgumentException(\"currentCID is empty\");\n        }\n\n        if (CollectionUtils.isEmpty(mqAll)) {\n            throw new IllegalArgumentException(\"mqAll is null or mqAll empty\");\n        }\n        if (CollectionUtils.isEmpty(cidAll)) {\n            throw new IllegalArgumentException(\"cidAll is null or cidAll empty\");\n        }\n\n        List<MessageQueue> result = new ArrayList<>();\n        if (!cidAll.contains(currentCID)) {\n            log.info(\"[BUG] ConsumerGroup: {} The consumerId: {} not in cidAll: {}\",\n                consumerGroup,\n                currentCID,\n                cidAll);\n            return result;\n        }\n\n        int index = cidAll.indexOf(currentCID);\n        result.add(mqAll.get(index % mqAll.size()));\n        return result;\n    }\n\n    private RemotingCommand setMessageRequestMode(ChannelHandlerContext ctx,\n        RemotingCommand request) throws RemotingCommandException {","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/broker/src/main/java/org/apache/rocketmq/broker/processor/QueryAssignmentProcessor.java#L268-L304","documentation":"QueryAssignmentProcessor.allocate requires cidAll — the sorted list of all consumer ids in the group — to be non-empty. Empty cidAll means the broker's consumer-group connection table had no members for the group at assignment time.","triggerScenarios":"QUERY_ASSIGNMENT arrives for a group whose consumer-id list is empty (all members just disconnected, or consumer registration didn't complete) while mqAll is valid.","commonSituations":"All consumers of a group reconnecting simultaneously; consumer registered but heartbeat/registration lost; aggressive rebalancing churn during rolling restarts.","solutions":["Ensure at least one consumer of the group is registered (heartbeat ok) before assignment; retry the assignment request.","Check client-to-broker connectivity and that consumers aren't crashing at startup.","In exclusive-consume mode, avoid restarting 100% of a group's consumers at once."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) { if (e.getMessage().contains(\"cidAll\")) { waitAndRetryAssignmentAfterReconnect(); } else throw e; }","preventionTips":["Keep at least one group member alive during rolling restarts.","Ensure consumer registration/heartbeat succeeds before assignment-heavy operations."],"tags":["rocketmq","broker","rebalance","query-assignment","consumer-group","validation"],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}