Skip to content

Backport #32181 to 2.0: stop pipeline alerts firing for historical and re-ingested executions - #32589

Merged
manerow merged 1 commit into
2.0from
backport/32181-to-2.0
Sep 4, 2026
Merged

manerow merged 1 commit into
2.0from
backport/32181-to-2.0

Conversation

@manerow

@manerow manerow commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #32181 (Fixes #31782) to 2.0.

An alert on Pipeline filtered to Failed is unusable on this branch: the metadata agent re-sends
the same numberOfStatus runs every cycle and each re-send emitted a change event, so one old
failure re-notifies forever; and the first ingestion after an alert is created emits a change event
per historical run, so enabling an alert produces a backfill burst. PUT /status/bulk additionally
emitted a single change event describing only the newest status, so a failure that was not the
newest run in a batch never alerted at all.

Full analysis, diagrams and manual-test tables are in #32181.

Why this is a manual PR. #32181 did carry To release, and the release cherry-pick workflow ran
for both release branches
(run 33819745878). On
2.0 the pick applied cleanly, but its direct push was rejected:

! [remote rejected]       2.0 -> 2.0 (push declined due to repository rule violations)

so the workflow asked for a manual cherry-pick. This is it. The companion 1.13 backport is
#32590.

Type of change:

  • Bug fix

High-level design:

One commit: git cherry-pick -x 3969ba38a7cb2188bdafc2d7ba5f10a2795c47e3, zero conflicts,
diffstat identical to the original (21 files, +607/-67).

A clean apply is not by itself proof the pick is correct on a release branch, so this was verified
rather than eyeballed: every file the commit touches was diffed against main's post-fix version.
All of the PR's own content is present, and the only differences are pre-existing 2.0 divergence
that this change never touches:

File main-only content this branch does not have
PipelineRepository the getTaskWorkflow / TaskDescriptionWorkflow / TaskTagWorkflow block
AlertUtil the Conversation alert path (CONVERSATION resource vs THREAD)
AbstractEventConsumer AccessControlDAOs.ChangeEventDAO vs CollectionDAO.ChangeEventDAO import

EventSubscriptionScheduler, EntityRepository, EventSubscriptionRepository, TableRepository,
PipelineResource, both JSON schemas, both generated TS files and the connector doc are
byte-identical to main. Every symbol the new code depends on already exists here:
routeToStagedIfActive, bulkIndexPipelineExecutions, getResultsFromAndToTimestamps,
upsertSubscriberExtension, and buildChangeEventJsonForBulkOperation /
insertChangeEventsBatch (the latter two arrived with the #32350 backport, #32535).

Migration folder stays 2.0.2. That is this branch's in-flight pom version and the next
unreleased folder here: 2.0.1-release shipped 2026-09-02 and the folders on 2.0 stop at 2.0.1.
Appending to an already-released folder would silently skip clusters that have executed 2.0.1,
because MigrationWorkflow.getReprocessingVersions only reprocesses the max executed version per
release train. The statement is idempotent (WHERE ... startingTimestamp IS NULL) and does not
touch $.timestamp, which change_event_consumers derives a NOT NULL generated column from.

Tests:

Unit tests

mvn -pl openmetadata-service -am package -Dtest='StalePipelineExecutionTest,PipelineStatusComparisonTest,AlertUtilTest,AbstractEventConsumerTest,SearchRepositoryBehaviorTest'
run on this branch: 208 run, 0 failures, 0 errors.

Suite Tests
StalePipelineExecutionTest (new) 9
PipelineStatusComparisonTest (new) 4
AlertUtilTest 38
AbstractEventConsumerTest 30
SearchRepositoryBehaviorTest 127

The two new suites carry the same 9 and 4 cases they have on main. openmetadata-service also
compiles clean end to end (-am package -DskipTests, main and test sources), which is the check
that catches a release-branch pick that applies without conflict but leans on a symbol only main
has.

Backend integration tests

Not applicable: no new REST endpoints. AlertsRuleEvaluatorDeletedEntityIT (the one IT the original
PR touched, to pass null to the widened getFilteredEvents) exists on this branch and is carried
over unchanged.

Ingestion integration tests

Not applicable: no connector changes.

Playwright (UI) tests

Not applicable: the only UI diff is regenerated types under generated/.

Manual testing performed

Covered on main in #32181 (backfill, identical re-send, stale logical_date, bulk batches, and
the migration against live MySQL and Postgres 15). Nothing in the backport diverges from what was
tested there.

Note on CI

Validate PR Metadata cannot pass on a release-branch PR: Fixes #N only creates GitHub's native
closingIssuesReferences when the PR targets the default branch, and the workflow's body regex
only accepts cross-repo forms. Bypassed with the documented skip-pr-checks label. The linked issue
is #31782, tracked on Shipping via #32181.

maven-collate-ci is red on every base-2.0 OSS PR and is not caused by this change: the collate
dispatch does a bare cd OpenMetadata && git checkout "$INPUT_SHA" with no prior fetch, so the
submodule clone never has the PR head object. Same on merged base-2.0 PRs #32509 and #32424.

UI screen recording / screenshots:

Not applicable.

Checklist:

…d re-ingested executions

(cherry picked from commit 3969ba3)
@manerow
manerow requested review from a team as code owners September 4, 2026 07:04
@github-actions

github-actions Bot commented Sep 4, 2026

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.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Sep 4, 2026
@manerow manerow added the skip-pr-checks Bypass PR metadata validation check label Sep 4, 2026
@gitar-bot

gitar-bot Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Backport of #32181 to 2.0 fixes pipeline alerts firing repeatedly for historical and re-ingested executions by properly emitting change events only for genuinely new status runs. All 208 unit tests pass and the code compiles cleanly. Consider optimizing the per-status deep-copy loop in PipelineRepository to copy the pipeline once and reset only the changed fields, avoiding O(n) full serialization on large batches during backfill.

✅ 1 resolved
✅ Performance: Full pipeline deep-copy per changed status in bulk loop

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/PipelineRepository.java:484-495 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/PipelineRepository.java:414-422
buildStatusChangeEvent does JsonUtils.deepCopy(pipeline, Pipeline.class) once per changed status. On the first ingestion after an alert is created (the backfill scenario this PR targets), every historical run is a CREATED change, so the whole Pipeline entity (including all tasks) is serialized+deserialized N times for one batch. This is functionally correct but O(n) full round-trips on a large batch. Consider deep-copying the pipeline once outside the loop and only resetting the per-status fields (pipelineStatus/changeDescription/updatedAt) on the shared snapshot before building each event JSON.

Options

Display: compact → Showing less information.

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 added safe to test Add this label to run secure Github workflows on PRs and removed safe to test Add this label to run secure Github workflows on PRs labels Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 67%
67.13% (80653/120143) 51.74% (49602/95850) 52.54% (14744/28060)

@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit fe9c657a8a6f6d9a4f3813c6dd556f9e59dd08c3 in Playwright run 33847215382, attempt 1.

✅ 1018 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 54m 51s

⏱️ Max setup 3m 57s · max shard execution 20m 8s · max shard-job elapsed before upload 23m 14s · reporting 8s

🌐 202.30 requests/attempt · 2.42 app boots/UI scenario · 27.40% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 27.4% (convergence target: at most 15%).
  • Browser traffic was 202.3 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.42 per UI scenario (2559 boots / 1057 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
🟡 Shard chromium-01 167 0 1 0 0 0
✅ Shard chromium-02 149 0 0 0 0 0
✅ Shard chromium-03 178 0 0 0 0 0
✅ Shard chromium-04 138 0 0 0 0 0
✅ Shard chromium-05 165 0 0 0 0 0
✅ Shard data-asset-rules-01 63 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 29 0 0 0 0 0
🟡 Shard ingestion-02 34 0 1 0 0 0
✅ Shard reindex-01 5 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 2 flaky test(s) (passed on retry)
  • Features/DataQuality/TableLevelTests.spec.ts › Table Column Name To Exist (shard chromium-01, 1 retry)
  • Features/TestSuitePipelineRedeploy.spec.ts › Re-deploy all test-suite ingestion pipelines (shard ingestion-02, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@manerow
manerow merged commit e503149 into 2.0 Sep 4, 2026
232 of 244 checks passed
@manerow
manerow deleted the backport/32181-to-2.0 branch September 4, 2026 13:42

This branch was previously deployed

1 inactive deployment
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.

2 participants