NUAAwqy opened a new pull request, #7344:
URL: https://github.com/apache/rocketmq-dashboard/pull/7344

   ## What is changed
   
   On a multi-master cluster, `listLiteTopics` reported a wrong `topicCount` 
and `totalBacklog` for parent topics sharded across brokers.
   
   ### Root cause
   
   `ParentTopicAccumulator.merge` unconditionally overwrote `brokerAddr` on 
every master iteration, so the accumulator ended up pinned to the last master 
in `brokerAddrTable` iteration order — an arbitrary broker — while the group 
set was unioned across masters. `buildSummary` then:
   
   - read `getParentTopicInfo(...).getLiteTopicCount()` from that single pinned 
broker, reporting one master shard as the whole count;
   - queried every group's backlog via `getLiteGroupInfo` on that same broker, 
which returns 0 (or fails and is swallowed) for groups whose lite subscription 
lives on another master — an active session's backlog silently read zero.
   
   ### Fix
   
   During discovery, remember which master reported each group and which 
masters report the parent. `buildSummary` now:
   
   - sums `getLiteTopicCount()` across the reporting masters;
   - queries each group's lag on the brokers that reported that group.
   
   Single-broker clusters issue exactly the same RPCs as before (covered by the 
existing tests). New regression test 
`listLiteTopicsSumsShardedParentsAcrossMasters` fails on the old code 
(topicCount 1 / backlog 5) and passes with the fix (topicCount 2 / backlog 12).
   
   ## Test
   
   - `mvn test -Dtest=RocketMQLiteTopicProviderTest` — 23/23 pass (22 existing 
+ 1 new regression test).


-- 
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