oss-taishan-ai commented on issue #10438: URL: https://github.com/apache/rocketmq/issues/10438#issuecomment-4646727095
**Issue Evaluation** Category: `type/bug` | Status: **Confirmed** The reported issue has been verified against the current codebase (develop branch). **Root Cause:** `TopicConfigManager.buildTopicConfigSerializeWrapper()` (line 631) sets the live `this.topicConfigTable` reference directly into the wrapper, while `dataVersion` is defensively copied. Meanwhile, `updateSingleTopicConfigWithoutPersist()` (lines 536-543) mutates the live map via `putTopicConfig()` *before* calling `updateDataVersion()`. This creates a concurrency window where a wrapper consumer (e.g., `needRegister()` in `BrokerController.java:2249`) can observe data that is inconsistent with the snapshot version. **Impact:** NameServer routing staleness — `needRegister()` may see version-data mismatch, causing missed or phantom registrations. Clients could route to stale topic configurations. **Severity:** Medium **Additional Note:** The overloaded `buildSerializeWrapper()` method (line 649) has the inverse problem — it passes `this.getDataVersion()` by live reference. The reporter's proposed fix (`new ConcurrentHashMap<>(this.topicConfigTable)`) correctly addresses the map snapshot, though for full atomic consistency both the map and `dataVersion` should be snapshotted under the same lock. An automated fix proposal can be generated. Reply `/approve` to proceed with PR generation. --- *Automated evaluation by github-manager-bot* -- 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]
