Aias00 opened a new issue, #7198: URL: https://github.com/apache/rocketmq-dashboard/issues/7198
### Before Creating the Bug Report - [x] Searched all-state issues and PRs for fresh/current samples, rule-test windows, and snapshot aggregation. - [x] This is a RocketMQ Studio defect. ### Studio Version `rocketmq-studio` at `127c47b06a268cc74224d5f34c56ec7c36ac0d55`. ### Runtime Environment Backend source review on macOS; verification uses JDK 21 and the dev H2 profile with the real metric snapshot repository. No live broker is needed: only collection is stubbed. ### Connected RocketMQ Cluster Not involved in reproducing the aggregation error. ### Describe the Bug `NativeAlertRuleTestService` collects a fresh sample without persisting it, then calls `NativeAlertSampleAggregator.aggregate`. If any stored window exists, the aggregator computes exclusively over those stored rows and discards the sample that triggered the test. `LAST` can return an older value and `AVG`, `SUM`, `MAX`, and `MIN` can evaluate the wrong condition. ### Steps to Reproduce 1. Store an AVAILABLE sample of consumer lag 10 for an instance/group at time T-30s. 2. Configure a 300s window and a condition `> 50`. 3. Make the rule test's collector return a fresh lag sample of 100 at T. 4. Test the rule. `LAST`, `AVG`, `SUM`, and `MAX` return 10 / false instead of 100, 55, 110, and 100 / true respectively. ### Expected Behavior Aggregate the historical window together with the unpersisted test observation. Keep the test read-only. The live evaluation path already persists the observation first and must not count it twice. ### Relation to Existing Work #6875 / merged PR #6876 fixed the opposite problem: rule tests previously ignored all window history. This is a regression in that new path: its mocks return a history containing the current sample, although the test service never saves that sample. Retain window aggregation while including the fresh observation. This report does not revisit the missing window aggregation or the future-bound hardening in open PR #5152. -- 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]
