From 402d31a1b88bf209f569f6c227048a01311defd3 Mon Sep 17 00:00:00 2001 From: cserwen Date: Sun, 24 Mar 2024 18:58:45 +0800 Subject: [PATCH] [ISSUE #7951] return the full statsInfo when read and write queues are inconsistent Co-authored-by: dengzhiwen1 --- .../rocketmq/broker/processor/AdminBrokerProcessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java b/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java index d0a03a93bf3..362caf9ca68 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java @@ -1551,7 +1551,9 @@ private RemotingCommand getTopicStatsInfo(ChannelHandlerContext ctx, } TopicStatsTable topicStatsTable = new TopicStatsTable(); - for (int i = 0; i < topicConfig.getWriteQueueNums(); i++) { + + int maxQueueNums = Math.max(topicConfig.getWriteQueueNums(), topicConfig.getReadQueueNums()); + for (int i = 0; i < maxQueueNums; i++) { MessageQueue mq = new MessageQueue(); mq.setTopic(topic); mq.setBrokerName(this.brokerController.getBrokerConfig().getBrokerName());