Skip to content

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

Merged
manerow merged 4 commits into
1.13from
backport/32181-to-1.13
Sep 7, 2026
Merged

manerow merged 4 commits into
1.13from
backport/32181-to-1.13

Conversation

@manerow

@manerow manerow commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

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

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 carried To release and the release cherry-pick workflow ran
(run 33819745878), but it
could not land on either branch: on 1.13 its git cherry-pick -x hit the three conflicts resolved
below, and on 2.0 (where it applies cleanly) the direct push was rejected with
push declined due to repository rule violations. The workflow asked for a manual cherry-pick; this
is it. The companion 2.0 backport is #32589.

Type of change:

  • Bug fix

High-level design:

One commit: git cherry-pick -x 3969ba38a7cb2188bdafc2d7ba5f10a2795c47e3, with three conflicts
resolved. Diffstat is the original's minus the one dropped file: 20 files, +606/-66 against the
original's 21 files, +607/-67.

Resolutions were verified, not eyeballed. For every file the commit touches, the delta this PR
applies (git diff origin/1.13 HEAD -- <file>, added and removed lines) was compared against the
delta the original applied on main. 17 of 20 files have a byte-identical delta, including both
conflicted Java files. The only three that differ are the three intentional adaptations:

1. AbstractEventConsumer (content conflict). The conflict swept in three context lines that
main already had before #32181 and 1.13 does not (lastReadOffset assignment, pendingGapSince,
gapStateChanged — the change-event gap-cursor work, never backported). #32181 adds exactly one line
here:

this.startingTimestamp = eventSubscriptionOffset.getStartingTimestamp();

Kept that, dropped the three context lines. The resulting file's delta is byte-identical to main's.

2. AlertUtil (content conflict). Same shape: the conflict region included the
COMPILED_CONDITIONS Caffeine cache, which is a main-only optimisation this branch does not have
(1.13 calls parseExpression(completeCondition) directly). #32181 adds one field here,
FIELD_PIPELINE_STATUS. Kept that, dropped the cache block and its Cache/Caffeine imports.
Confirmed there is no residual COMPILED_CONDITIONS reference. Delta again byte-identical to
main's.

3. AlertsRuleEvaluatorDeletedEntityIT (modify/delete). The file does not exist on 1.13; it
arrived on main after this branch was cut. Its only change in #32181 was passing null to the
widened getFilteredEvents, so there is nothing to preserve. Dropped. Verified there is no other
caller of getFilteredEvents anywhere in openmetadata-integration-tests on this branch, so no
dangling call site is left behind.

Migration folder moved 2.0.2 -> 1.13.6, SQL body unchanged (only the -- ... OpenMetadata <version> header line differs). 1.13.6 is this branch's in-flight pom version and the next
unreleased folder here: 1.13.5-release shipped 2026-09-03 and the folders on 1.13 stop at
1.13.5. Appending to 1.13.5 would silently skip every cluster that has already executed it,
because MigrationWorkflow.getReprocessingVersions only reprocesses the max executed version per
release train. The statement is idempotent (WHERE ... startingTimestamp IS NULL) and leaves
$.timestamp alone, which change_event_consumers derives a NOT NULL generated column from, so a
cluster that later upgrades onto the 2.0 line and runs 2.0.2 sees 0 rows there.

Nothing else needed adapting. Every symbol the new code depends on already exists on 1.13:
routeToStagedIfActive, bulkIndexPipelineExecutions, getResultsFromAndToTimestamps,
getExtensionAtTimestamp, upsertSubscriberExtension, and buildChangeEventJsonForBulkOperation /
insertChangeEventsBatch (the latter two from the #32350 backport, #32536). The alertType enum is
identical to main's, so the Notification/Observability scoping of the new filter behaves the
same here. getStartingOffset has the same five call sites as on main, so the one behavioural
change that writes on read (persisting the offset row on first derivation) has the same blast radius.
PipelineResourceIT on this branch is a strict subset of main's — zero lines exist here that do
not exist there — including all seven pipeline-status test methods, so no branch-local assertion can
disagree with the new behaviour.

Second commit: test(1.13): make SecurityConfigurationManagerTest order-independent. Not part of
the fix; it repairs a branch-level defect this PR happens to expose.
SecurityConfigurationManagerTest.testConfigGettersReturnNullWhenNotInitialized reads three static
getters on a singleton and its else branch asserts auth and authz are non-null, so it fails
whenever a previously-run test leaves the singleton partially initialised. openmetadata-service
runs surefire single-fork with runOrder=filesystem, so all 6273 tests share one JVM and its statics,
and the two test classes this backport adds are enough to shift the Linux runner's ordering onto a
polluting predecessor. Evidence it is not the pipeline-alert change:

  • the failure is deterministic, not flaky (CI attempt 2 reproduced it exactly);
  • the two new classes are not the polluter - running StalePipelineExecutionTest and
    PipelineStatusComparisonTest immediately before it in one JVM leaves it green (9/9), and neither
    uses mockStatic, so neither can leak one;
  • the byte-identical commit on 2.0 (Backport #32181 to 2.0: stop pipeline alerts firing for historical and re-ingested executions #32589) passes the same suite;
  • the full 6273-test suite passes locally on this branch (macOS orders the directory differently).

The reason 2.0 is immune is that upstream already fixed this test in b16f585789, which is on
2.0 and main but never reached 1.13: it changes else { assertNotNull(auth); assertNotNull(authz); }
to else if (auth != null) { assertNotNull(auth); } and adds a comment saying the singleton may
already be initialised. This commit applies exactly that, so the method is now byte-identical to the
one 2.0 and main already run. Test-only, no production code.

Tests:

Unit tests

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

Suite Tests
StalePipelineExecutionTest (new) 9
PipelineStatusComparisonTest (new) 4
AlertUtilTest 35
AbstractEventConsumerTest 24
SearchRepositoryBehaviorTest 115

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. The one IT the original PR touched does not exist on this
branch (see resolution 3 above).

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). The backport carries byte-identical logic, so
nothing there is re-litigated here.

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-sonarcloud-ci is red on every base-1.13 PR that touches Java and is not caused by this
change: pull_request_target runs the workflow from the default branch, and its
Restore openmetadata-ui dist cache step uses .github/actions/cache-ui-dist, which does not exist
on 1.13. Same failure on the merged base-1.13 Java backport #32536.

UI screen recording / screenshots:

Not applicable.

Checklist:

…nd re-ingested executions

(cherry picked from commit 3969ba3)
@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.

@manerow manerow added safe to test Add this label to run secure Github workflows on PRs backend skip-pr-checks Bypass PR metadata validation check 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: 63%
63.57% (61420/96603) 44.98% (33794/75117) 46.9% (10304/21969)

@manerow
manerow force-pushed the backport/32181-to-1.13 branch from a938982 to 3c67576 Compare September 5, 2026 11:20
@gitar-bot

gitar-bot Bot commented Sep 7, 2026

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

Backport of #32181 to 1.13 stops pipeline alerts from firing on historical and re-ingested executions by filtering change events to only those with execution timestamps at or after the alert's creation. Resolves three merge conflicts with careful preservation of the original logic—17 of 20 files have byte-identical deltas to main, and the intentional adaptations (AbstractEventConsumer, AlertUtil, and dropping the non-existent AlertsRuleEvaluatorDeletedEntityIT) are verified. Includes a test-only fix to SecurityConfigurationManagerTest for order-independent execution. No issues found.

✅ 1 resolved
✅ Performance: Full pipeline deep-copied once per status in bulk backfill loop

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/PipelineRepository.java:413-421 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/PipelineRepository.java:483-494
In addBulkPipelineStatus, buildStatusChangeEvent runs JsonUtils.deepCopy(pipeline, Pipeline.class) for every changed status. A first ingestion after an alert exists is exactly the backfill burst this PR targets, so N can be the pipeline's entire execution history — each iteration serializes and re-parses the whole (potentially large) Pipeline entity purely to swap pipelineStatus/changeDescription. Deep-copy the pipeline once outside the loop and reset only the per-status fields before each buildChangeEventJsonForBulkOperation call, since the snapshot is serialized immediately and not retained.

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

@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

@manerow
manerow merged commit c981905 into 1.13 Sep 7, 2026
128 of 129 checks passed
@manerow
manerow deleted the backport/32181-to-1.13 branch September 7, 2026 11:24

This branch was previously deployed

1 inactive deployment
test — 0b770169 Deployed Sep 7, 2026 by manerow via playwright-ci-postgresql (4, 6) #81081
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