unbridled-41 opened a new issue, #3359:
URL: https://github.com/apache/rocketmq-dashboard/issues/3359

   ## Problem
   
   A topic that exists in the Studio metadata database but has no broker route 
(partially failed create, replaced cluster, DB import) breaks two read flows of 
the topic page:
   
   1. **Topic detail modal** — `GET /topics/{name}/routes` and `GET 
/topics/{name}/consumers` both return 502, so the modal shows "Topic 
详情加载失败,请稍后重试" instead of the detail view.
   2. **同步数据 (sync DB topics to broker)** — the sync flow catches each 
per-topic route failure and filters it out, so the missing-route list it exists 
to produce never contains those topics; the user only sees "部分 Topic 路由校验失败".
   
   ## Evidence / source
   
   - Code inspection of the current `rocketmq-studio` branch (base commit 
36126024): `examineTopicRouteInfo`/`queryTopicConsumeByWho` throw 
`MQClientException` `CODE: 17` (`TOPIC_NOT_EXIST`, "Not found topic route info 
in name server for topic: X") and both 
`RocketMQMetadataProvider.getTopicRoutes` and `getTopicConsumersPage` turn any 
exception into `BusinessException(502)` — although the class javadoc documents 
"a record without a broker route surfaces as an empty route list instead of 
being hidden".
   - Red-first regressions in `RocketMQMetadataProviderTest` fail on the 
unfixed source with exactly `Failed to get routes for topic TopicA: CODE: 17  
DESC: Not found topic route info in name server for topic: TopicA` (and the 
consumers variant): 
`getTopicRoutesShouldReturnEmptyListWhenTopicHasNoBrokerRoute`, 
`getTopicConsumersShouldReturnEmptyPageWhenTopicHasNoBrokerRoute`.
   
   ## Impact
   
   The topic page's detail and sync flows are unusable for metadata records 
without broker routes; the sync feature cannot detect the topics it was built 
for. Read-only paths; no writes are affected.
   
   ## Expected behavior / acceptance criteria
   
   - `TOPIC_NOT_EXIST` is treated as the definitive "absent on the broker" 
answer: empty route list / empty consumer page.
   - Every other admin failure (transport, broker errors, timeouts) keeps 
surfacing as a 502 so real failures stay distinguishable from empty data, as 
demanded by closed #1163 — the existing 
`getTopicRoutesSurfacesAdminFailure`/`getTopicConsumersSurfacesAdminFailure` 
tests pin this.
   
   ## Related work
   
   - #1041 / merged #1043 established the same benign-classification for 
producer connections (`RocketMQClientProvider.isTopicNotExist` → empty list); 
the routes/consumers paths were outside that scope.
   - Open PR #3102 fixes a different defect in the same method (name trim/blank 
short-circuit); hunks do not overlap.
   - #3305 tracks the same 502-vs-empty family for message key queries 
(`NO_MESSAGE`), a different endpoint and provider.
   
   ## PR
   
   PR #3346 (fix plus two regression tests, red-first).


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