zmuxuny opened a new issue, #4510:
URL: https://github.com/apache/rocketmq-dashboard/issues/4510

   ### Before Creating the Bug Report
   
   - [x] I searched open/closed issues and PRs for Tencent `ConsumerLag`, 
unknown lag, zero backlog, and cloud metrics handling.
   - [x] I verified the behavior on current `master` 
(`987b748e8f4f421c5cd3c4c4e51a064cc7e59f18`).
   
   ### Problem
   
   Tencent RocketMQ 5.x `SubscriptionData.ConsumerLag` is nullable. Tencent's 
current API documentation explicitly states that null means no valid value can 
be obtained. Studio currently converts that state to zero in both:
   
   - `TencentInstanceProvider.getGroupProgress`;
   - `TencentInstanceProvider.toTopicConsumer`.
   
   The frontend already treats `-1` as the backend's unavailable-lag sentinel, 
while a real `0` is rendered as a healthy zero backlog.
   
   The second layer is `CloudRocketMqBusinessMetricsCollector`: it applies 
`Math.max(0, diffTotal)`, so even after a provider reports the established 
negative unknown sentinel, the cloud metric path would convert it back to zero.
   
   ### Impact
   
   A missing Tencent lag value can be presented as a trustworthy `0` in 
Consumer progress and Topic-consumer views. The same unknown value can enter 
native cloud metrics as AVAILABLE zero, which can suppress backlog alerts and 
make an unavailable measurement look healthy.
   
   ### Expected behavior
   
   - Map Tencent `ConsumerLag == null` to the existing unknown-lag sentinel 
(`-1`), not zero.
   - Preserve genuine `ConsumerLag == 0` as zero.
   - Cloud business metrics must treat any unknown row as unavailable for 
aggregate group lag/max metrics rather than clamp it to zero.
   - Per-topic backlog samples should preserve known topics and mark an unknown 
topic unavailable.
   
   ### Verification plan
   
   Add red-first provider tests for null lag in group progress and 
topic-consumer mapping, plus collector tests for mixed known/unknown progress. 
Verify UI/API sentinel semantics remain compatible and known-zero behavior is 
unchanged.
   
   AI-assisted source audit. Tencent's current `SubscriptionData` documentation 
states that `ConsumerLag` may return null when a valid value cannot be obtained.
   


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