RockteMQ-AI commented on issue #10713: URL: https://github.com/apache/rocketmq/issues/10713#issuecomment-5140738511
**Issue Evaluation** Category: `type/enhancement` | Status: **Evaluated** **Feasibility:** Feasible **Scope:** `broker/src/main/java/org/apache/rocketmq/broker/filter/ConsumerFilterManager.java` **Compatibility:** No breaking changes — internal data structure optimization. The analysis is accurate. Code verification confirms: 1. `getByGroup()` (line 177) performs a full scan of `filterDataByTopic` — O(T×G) per heartbeat. 2. `bloomFilter.generate()` (line 155) is called unconditionally in `register()`, regardless of `enableCalcFilterBitMap`. 3. Multiple `containsKey()` + `get()` sequences (lines 167/170, 199/202) exhibit TOCTOU race conditions on `ConcurrentHashMap`. The proposed dual-index approach (adding `subscriptionFilterData` for O(1) consumerGroup lookups) is sound. Maintaining both indexes preserves the fast topic-based lookup path used by `CommitLogDispatcherCalcBitMap` during message dispatch. **Recommendation:** The fix is well-scoped and low-risk. A PR would be welcome. --- *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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
