You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "unbridled-41 (via GitHub)" <gi...@apache.org> on 2026/09/20 07:05:07 UTC
[I] [Studio][Bug] Topic comparison drawer renders a superseded comparison under the new instance pair [rocketmq-dashboard]
unbridled-41 opened a new issue, #4585:
URL: https://github.com/apache/rocketmq-dashboard/issues/4585
## Problem
The cross-instance Topic configuration comparison drawer (`TopicConfigComparisonDrawer`, opened from the topic page with 配置对比) guards its comparison with a request-generation counter, but only `runComparison` bumps it. Changing the compared pair — the 源实例 select, the 目标实例 select, or the swap button — clears the visible result without invalidating the request that is still in flight.
Steps to reproduce:
1. Open the topic page and click 配置对比.
2. Pick two instances and click 开始对比.
3. While the comparison is loading, change the 源实例 (or 目标实例, or press the swap button).
4. The comparison finishes and is rendered for the new selection.
Because the labels are read from the *current* pair while the rows come from the *previous* one, the drawer then reports the previous pair's drift under the new pair's names: the expanded field table columns are titled `sourceInstanceId`/`targetInstanceId` (`web/src/components/TopicConfigComparisonDrawer.tsx:313`), and 导出结果 writes `rocketmq-topic-config-<new source>-vs-<target>.csv` (`:164`) while the exported rows are the stale ones.
## Studio Version
branch: master
git commit id: d50ffecc9d7e8f8f46da64198831bd7952e6974e
deployed as: built from source (frontend only)
## Evidence
- `web/src/components/TopicConfigComparisonDrawer.tsx:128` bumps `requestIdRef` and `:135`/`:141`/`:143` compare against it, but the three pair-changing paths at `:211` (源实例), `:224` (目标实例) and `:147` (`swapInstances`) only call `setResult(null)`, so the in-flight response still passes the guard and repopulates the result.
- Regression test `web/src/components/__tests__/TopicConfigComparisonDrawer.test.tsx` ("discards a comparison that resolves after the instance pair changed") fails on `master`:
```
FAIL src/components/__tests__/TopicConfigComparisonDrawer.test.tsx > TopicConfigComparisonDrawer > discards a comparison that resolves after the instance pair changed
Error: expect(element).not.toBeInTheDocument()
expected document not to contain element, found <div class="ant-statistic-title">配置一致</div> instead
❯ src/components/__tests__/TopicConfigComparisonDrawer.test.tsx:243:44
Test Files 1 failed (1)
Tests 1 failed | 7 passed (8)
```
## Impact
An operator who switches the compared instances while the drawer is loading reads a drift report that belongs to a different pair, and can export it under the new pair's file name — for example as evidence in a change ticket.
## Expected behavior
A comparison belongs to the pair it was started for. Once the pair changes, a response for the previous pair must be discarded instead of being rendered under the new selection.
## Related work
- #3154 and #4166 (merged) — the same request-ownership contract on the cluster page (Broker config diff and preview).
- #4331 (merged) — unified those per-page request guards, which is the pattern this drawer still misses on its pair-changing paths.
## PR
Fix: #PR_PLACEHOLDER.
--
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-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Studio][Bug] Topic comparison drawer renders a superseded comparison under the new instance pair [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on issue #4585:
URL: https://github.com/apache/rocketmq-dashboard/issues/4585#issuecomment-5811760174
Fixed in fff275140 (#4586) on the `rocketmq-studio` branch.
Closing manually: GitHub only auto-closes an issue when the pull request is merged into the repository's default branch, and `rocketmq-studio` is not it.
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Studio][Bug] Topic comparison drawer renders a superseded comparison under the new instance pair [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed issue #4585: [Studio][Bug] Topic comparison drawer renders a superseded comparison under the new instance pair
URL: https://github.com/apache/rocketmq-dashboard/issues/4585
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Studio][Bug] Topic comparison drawer renders a superseded comparison under the new instance pair [rocketmq-dashboard]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #4585:
URL: https://github.com/apache/rocketmq-dashboard/issues/4585#issuecomment-5749131125
**Issue Evaluation**
Category: `bug` | Status: **Confirmed**
The reported issue has been verified against the current codebase at `d50ffecc9d`.
**Root Cause:** In `TopicConfigComparisonDrawer.tsx`, the request-generation counter (`requestIdRef`) is only bumped inside `runComparison` (line 128). The three instance-pair-changing paths — source `onChange` (line 211), target `onChange` (line 224), and `swapInstances` (line 147) — only call `setResult(null)` without invalidating the in-flight request. When the async comparison resolves, the guard `requestId === requestIdRef.current` still passes, and the stale result is rendered under the new pair's labels.
**Impact:** An operator switching instances during loading sees a drift report belonging to a different pair, and may export it under the wrong filename — potentially as evidence in a change ticket.
**Severity:** Medium — data integrity issue in the comparison output, no data loss or crash.
**Fix:** Bump `requestIdRef.current` in the source/target `onChange` handlers and `swapInstances` to invalidate in-flight requests when the pair changes.
A fix has already been proposed in PR #4586.
---
*Automated evaluation by RockteMQ-AI*
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org