zjncs opened a new pull request, #11111:
URL: https://github.com/apache/rocketmq/pull/11111

   ## Motivation
   
   `AdminBrokerProcessor.cloneGroupOffset` supports a blank-topic mode 
(`UtilAll.isBlank(requestHeader.getTopic())`) that clones the offsets of 
**every** topic the source group consumes — this is `mqadmin cloneGroupOffset` 
without `-t`. The method collects the topic set and iterates it, but then calls:
   
   ```java
   this.brokerController.getConsumerOffsetManager().cloneOffset(
       requestHeader.getSrcGroup(), requestHeader.getDestGroup(),
       requestHeader.getTopic());   // <-- null in the blank-topic mode
   ```
   
   `ConsumerOffsetManager.cloneOffset` looks up `topic + TOPIC_GROUP_SEPARATOR 
+ srcGroup`, so with a null topic the key `null@srcGroup` never matches: no 
offset is cloned, yet the broker replies SUCCESS. The whole "clone all topics 
of a group" admin feature silently does nothing.
   
   ## Modification
   
   Pass the loop variable `topic` to `cloneOffset`. In the explicit-topic mode 
the two are identical, so only the blank-topic mode changes (from no-op to 
actually cloning).
   
   ## Test Evidence
   
   Fail-before (unpatched develop, new regression test):
   
   ```
   mvn -q -pl broker test 
-Dtest='AdminBrokerProcessorTest#testCloneGroupOffsetWithoutTopicClonesEveryTopicOfSourceGroup'
   Argument(s) are different! Wanted: cloneOffset("srcGroup", "destGroup", 
"cloneTopic1")
   ```
   
   Pass-after (full class):
   
   ```
   mvn -q -pl broker test -Dtest='AdminBrokerProcessorTest'
   Tests run: 94, Failures: 0, Errors: 0, Skipped: 0
   ```
   
   No associated issue (self-discovered during a broker-module self-audit).


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to