You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Studio][Bug] A rule with a padded stored instance id fires but reports no active alert state #4297
A native alert rule whose stored instanceId has surrounding whitespace fires and keeps writing FIRING/ACKED rows, but reports no active state:
GET /api/cluster-alert-rules/runtime and the system-alerts active view omit a genuinely firing
alert, so the operator sees "no active alert" while incident rows keep being produced;
NativeAlertProcessor.reconcileMissingActiveStates never sees the state, so it is never resolved
and the incident cannot be cleared.
The metric on the line above is trimmed, the instance id is not. The identical filter in NativeAlertProcessor.reconcileMissingActiveStates (:101-103) has the same shape, so the rule is
dropped from the reconcile candidate list as well.
Everything that decides whether a rule fires trims instead:
NativeAlertMetricCatalogService.java:54 - findByIdentifier(instanceId.trim()) (so validation of
a padded id passes)
NativeAlertRuleTestService.java:94-96 - normalises the instance id before matching
AlertRuleRequestDTO.toAlertRuleVO() copies instanceId untrimmed and MybatisPlusAlertRepository.toRuleEntity() persists it verbatim, so a stored " inst-1 " is
reachable through POST /api/cluster-alert-rules/create.
3. Impact
A rule can fire while its active state is invisible, so the alert appears to vanish between
notifications and its FIRING/ACKED row is never resolved.
The padding is invisible in the API response, so the state cannot be explained from the UI.
4. Reproduction
Create a cluster alert rule with instanceId padded, e.g. {"instanceId": " local ", ...}
(it is accepted and stored verbatim).
Let the rule fire.
GET /api/cluster-alert-rules/runtime reports no active state for that rule, while rmq_alert_state holds a FIRING row for it.
5. Expected behaviour
The instance selector is normalised exactly like the metric selector on the line above, in both the
state lookup and the reconcile candidate filter, so a padded stored value matches the collection
scope.
Thank you for reporting this. It has been classified as a potential bug and is queued for code-level verification against the current codebase.
If confirmed, an automated fix proposal may be generated. You can reply with /approve to proceed, or provide additional context to help with verification.
Resolved by #4464, merged into rocketmq-studio as aaaa957.
MybatisPlusAlertStateRepository.findActive now trims the stored instance id before comparing it with the collection scope, so a padded value matches. NativeAlertProcessor's reconcile filter was aligned to the same judgment (StringUtils.hasText rather than a null check), which keeps a blank instance id meaning "every instance" on both paths — previously a rule stored as an empty string was treated as global by the query but never reconciled by the processor. Both paths carry a regression test.
Activity
RockteMQ-AI commentedon Sep 15, 2026
Issue Evaluation
Category:
bug| Status: Under ReviewThank you for reporting this. It has been classified as a potential bug and is queued for code-level verification against the current codebase.
If confirmed, an automated fix proposal may be generated. You can reply with
/approveto proceed, or provide additional context to help with verification.Automated evaluation by RockteMQ-AI
fix(alert): match padded instance ids and render alert windows and pl…
lizhimins commentedon Sep 21, 2026
Resolved by #4464, merged into
rocketmq-studioas aaaa957.MybatisPlusAlertStateRepository.findActivenow trims the stored instance id before comparing it with the collection scope, so a padded value matches.NativeAlertProcessor's reconcile filter was aligned to the same judgment (StringUtils.hasTextrather than a null check), which keeps a blank instance id meaning "every instance" on both paths — previously a rule stored as an empty string was treated as global by the query but never reconciled by the processor. Both paths carry a regression test.