zmuxuny opened a new pull request, #4540: URL: https://github.com/apache/rocketmq-dashboard/pull/4540
### Which Issue(s) This PR Fixes - Fixes #4539 ### Brief Description Apache reset-offset preview previously computed queue lag with `Math.max(0, brokerOffset - consumerOffset)`. That conflicts with Studio's established `ConsumerLagResolver.UNKNOWN` (`-1`) contract for RocketMQ 5.x gRPC/POP progress where a negative broker difference means lag cannot be determined. This change reuses the existing unknown-lag contract for current and projected preview lag. Aggregate current/projected backlog is also unknown when any contributing queue is unknown, rather than summing fabricated zeroes. A warning tells operators that affected backlog totals are unavailable. Reset target, offset delta, rewind/fast-forward counts, and `allowReset` semantics are unchanged when offset lookup succeeds. ### Red / Green Verification Baseline: `master@d50ffecc9d7e8f8f46da64198831bd7952e6974e`. Fail-before, Java 21: - Added a queue with `brokerOffset=100`, `consumerOffset=120`, and a valid reset target at 80. - `RocketMQAdminClientImplTest`: **65 tests, exactly 1 failure**. - Expected `currentLag/currentTotalLag=-1`, but current master returned healthy `0`; the other 64 tests passed. Green, Java 21: - `RocketMQAdminClientImplTest`: **66/66 passed** with current-unknown and projected-unknown coverage. - `RocketMQAdminClientImplTest,MetadataServiceTest,ConsumerGroupControllerTest,GroupMutationPlanTest`: **143/143 passed**. - Checkstyle: **0 violations**. - `mvn -B -ntp -DskipTests package`: **BUILD SUCCESS**. - `git diff --check`: clean. ### Compatibility / Risk No API schema, frontend, dependency, reset execution, or known-zero/positive lag behavior changes. The existing UI already renders negative lag as unavailable (`-`), so no frontend change is required. Only lag values that were previously clamped from an unresolved negative difference to zero now preserve the established unknown sentinel. The reset can still proceed when its offset target is otherwise complete; the preview simply stops presenting unavailable backlog as healthy. AI-assisted source audit, implementation and regression authoring; fail-before and green verification were executed locally against the stated baseline. -- 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]
