RockteMQ-AI commented on PR #4336:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/4336#issuecomment-5682169439

   ## 🤖 Automated Code Review
   
   **PR:** [ISSUE #4333] Add Topic Message Deduplication & Idempotency Health 
Diagnostic Engine
   **Verdict: ❌ Critical Issues — Not Ready for Merge**
   
   ### 🔴 Critical: Service Returns Fabricated Diagnostic Data
   
   The service implementation generates fake deduplication metrics using 
hash-based random values:
   
   ```java
   // TopicDeduplicationHealthServiceImpl.java
   long duplicates = 15L + (Math.abs(topic.hashCode()) % 45);
   ```
   
   The diagnostic engine reports fabricated duplicate counts, fake sample 
message IDs, and invented health scores. This is particularly dangerous because:
   1. Operators might take action based on false duplicate alerts
   2. Real deduplication issues would be masked by the fake data
   3. The "health score" has no correlation with actual system state
   
   ### 🔴 Critical: `sampleMsgIds` Are Fabricated
   
   The service generates fake message IDs like:
   ```java
   "sample-" + topic + "-" + i
   ```
   
   These are not real message IDs from the broker. Any attempt to investigate 
the reported "duplicates" would lead to dead ends.
   
   ### ⚠️ Other Issues
   - **No integration with `ConsumeQueue`** or `CommitLog` for real message 
scanning
   - **No actual deduplication detection algorithm** — just random numbers
   - **No configurable sampling strategy** — the "sampleSize" parameter is 
ignored in favor of fake data
   - **No tests** for actual diagnostic logic
   
   ### Recommendation
   This PR needs:
   1. Real message scanning via `ConsumeQueue` iteration
   2. Actual deduplication detection (e.g., hash-based duplicate counting)
   3. Real message ID references in the diagnostic report
   4. Integration with the store layer for accurate metrics
   
   ---
   <sub>🔍 Automated review by RockteMQ-AI. Please verify suggestions before 
applying.</sub>


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