Ziy1-Tan commented on code in PR #7325: URL: https://github.com/apache/rocketmq/pull/7325#discussion_r1320554205
########## broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java: ########## @@ -1766,36 +1767,63 @@ public synchronized void registerIncrementBrokerData(List<TopicConfig> topicConf } public synchronized void registerBrokerAll(final boolean checkOrderConfig, boolean oneway, boolean forceRegister) { + ConcurrentMap<String, TopicConfig> topicConfigMap = this.getTopicConfigManager().getTopicConfigTable(); + ConcurrentHashMap<String, TopicConfig> topicConfigTable = new ConcurrentHashMap<>(); - TopicConfigAndMappingSerializeWrapper topicConfigWrapper = new TopicConfigAndMappingSerializeWrapper(); + for (TopicConfig topicConfig : topicConfigMap.values()) { + if (!PermName.isWriteable(this.getBrokerConfig().getBrokerPermission()) + || !PermName.isReadable(this.getBrokerConfig().getBrokerPermission())) { + topicConfigTable.put(topicConfig.getTopicName(), + new TopicConfig(topicConfig.getTopicName(), topicConfig.getReadQueueNums(), topicConfig.getWriteQueueNums(), + topicConfig.getPerm() & getBrokerConfig().getBrokerPermission())); + } else { + topicConfigTable.put(topicConfig.getTopicName(), topicConfig); + } - topicConfigWrapper.setDataVersion(this.getTopicConfigManager().getDataVersion()); - topicConfigWrapper.setTopicConfigTable(this.getTopicConfigManager().getTopicConfigTable()); + if (this.brokerConfig.isEnableSplitRegistration() + && topicConfigTable.size() >= this.brokerConfig.getSplitRegistrationSize() + && needRegister(forceRegister)) { Review Comment: Fixed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org