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

   ### Before Creating the Bug Report
   
   - [x] I searched open/closed issues and PRs for Apache unknown queue lag, 
`consumer.lag.max_queue`, topic backlog and metrics availability.
   - [x] I verified the behavior on current `master` 
(`987b748e8f4f421c5cd3c4c4e51a064cc7e59f18`).
   
   ### Problem
   
   `RocketMQMetadataProvider.getGroupProgress` preserves unresolved queue lag 
as `ConsumerLagResolver.UNKNOWN` (`-1`). This can happen when broker offsets 
yield an invalid negative difference and the Proxy fallback cannot resolve an 
authoritative lag.
   
   `ApacheRocketMqBusinessMetricsCollector` correctly marks group 
`consumer.lag.total` unavailable when the group summary carries that unknown 
sentinel, but its queue-level collection then clamps every `diffTotal` through 
`Math.max(0, value)`.
   
   That produces contradictory native metrics for the same consumer group: 
`consumer.lag.total` can be UNAVAILABLE while `consumer.lag.max_queue` and 
`topic.backlog.total` are published as AVAILABLE values derived by treating 
unknown queues as zero.
   
   ### Impact
   
   Native alert rules can consume fabricated healthy queue/backlog values when 
one or more queue lags are actually unavailable. This is especially relevant to 
RocketMQ 5.x gRPC/POP paths where negative broker-side lag uses Proxy fallback 
and may remain unknown.
   
   ### Expected behavior
   
   - If any queue-progress row has unknown lag, group `consumer.lag.max_queue` 
is UNAVAILABLE.
   - Topic backlog remains granular: a topic containing an unknown row is 
UNAVAILABLE, while unrelated topics with complete known rows keep their valid 
samples.
   - Known zero and positive lag remain AVAILABLE and unchanged.
   - Existing `consumer.lag.total` / delay availability behavior stays 
unchanged.
   
   ### Verification plan
   
   Add a red-first collector regression with mixed known/unknown queue 
progress. Prove the unmodified collector publishes queue/topic metrics as 
AVAILABLE, then preserve known topic samples while propagating unknown 
availability to the affected aggregate/topic. Run Apache provider/collector and 
native-alert suites plus package/checkstyle.
   
   This is the Apache-provider counterpart of the same unknown-value integrity 
principle, not a provider transport change.
   
   AI-assisted source audit; the current provider and collector control flow 
were verified before filing.
   


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