Skip to content

[2.1] Fixes #38280: Report nothing pending for a disabled alert (backport 2.1 #38279) - #38555

Merged
manerow merged 5 commits into
2.1from
backport/2.1/disabled-alert-nothing-pending
Nov 24, 2026
Merged

manerow merged 5 commits into
2.1from
backport/2.1/disabled-alert-nothing-pending

Conversation

@manerow

@manerow manerow commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Issue

Cherry-pick of #38279 to 2.1 (Fixes #38280). The change is identical: the backport has the same patch id as the main PR, and it applied with no conflicts.

Why 2.1 needs it

The files this fix touches are the same on 2.1 as on main, so 2.1.0 has the bug. 2.1 also skips the backlog when an alert is enabled again, so the events a disabled alert reports as pending will never be sent. Upgrading from 2.0.2 to 2.0.x to 2.1 carries over the saved positions that 2.0 wrote the first time someone opened the page of an alert created disabled. Those alerts can be far behind, and opening their page is costly.

Problem

A disabled alert has no job, so its saved position never moves. While it stayed off, every reader of "what is unread" counted from that position: "500+" pending on its page, unprocessed events in its diagnostics, a growing lag, and processedEvents false. None of it would ever be sent.

What this PR changes

  • A disabled alert is reported as not running. Every reader goes through AlertProgress.of, which for a disabled alert reports nothing pending or unread, and "processed all events" true, since enabling it starts from the latest event.
  • Diagnostics still show the real stored currentOffset and startingOffset, because support needs them. What it delivered or failed before is still counted.
  • eventsRecord and diagnosticInfo now return enabled, so a disabled alert does not look like a healthy idle one. The change is additive.
  • The saved position is not touched, and enabling still skips the backlog, so only new events are sent.

The rule is recorded in docs/decisions/2026-11-19-a-disabled-alert-has-nothing-pending.md.

Not in this PR

The UI follow-up, #38286 (alert status and the enable switch), is still in review on main. It gets its own 2.1 backport once it merges.

Tests

  • AlertProgressTest (new): a disabled alert has nothing pending, never counts or lists change events, reports where it stopped and keeps what it handled. An enabled alert still reads from its position.
  • AlertDeliveryIT: a disabled alert, whether it ran before or was created disabled with a row an older release wrote, reports enabled: false and nothing pending over REST. Once enabled, it delivers only what happens from then on.

Local Java test run: PASSED

  • Commit: eeb430eff627 (base origin/2.1)
  • Finished: 2026-11-24 07:33 UTC · 4.2 min
  • Scope: focused; merge readiness is not established. Broader steps deferred: 3 (run --scope full).
Step Scope Classes Tests Failed Skipped Min Result
unit openmetadata-service (2 classes) 2 6 0 0 1.1 passed
integration mysql-elasticsearch · parallel 1 6 0 0 3.1 passed

@manerow
manerow requested a review from a team as a code owner November 24, 2026 07:34
@manerow
manerow requested review from IceS2 and removed request for a team November 24, 2026 07:34
@manerow manerow self-assigned this Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@manerow manerow added backend skip-pr-checks Bypass PR metadata validation check safe to test Add this label to run secure Github workflows on PRs labels Nov 24, 2026
@gitar-bot

gitar-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Changing disabled-alert progress to zero pending and processed-all could affect client monitoring, while additive enabled fields expose its state.

Disabled alerts now report nothing pending or unread and are shown as not running, while diagnostics keep the stored offsets and delivery counts. The change adds an enabled field to eventsRecord and diagnosticInfo and leaves the saved position untouched, so enabling still sends only new events. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@manerow
manerow merged commit 2f851ff into 2.1 Nov 24, 2026
52 of 54 checks passed
@manerow
manerow deleted the backport/2.1/disabled-alert-nothing-pending branch November 24, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant