Skip to content

Backport #32350 to 1.13: emit ChangeEvents for bulk entity updates - #32536

Merged
manerow merged 2 commits into
1.13from
backport/32350-1.13
Sep 3, 2026
Merged

manerow merged 2 commits into
1.13from
backport/32350-1.13

Conversation

@manerow

@manerow manerow commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #32350 (Fixes #32092) to 1.13. This is the branch the issue was reported against
(1.13.3, Pylon 21043).

PUT /v1/{collection}/bulk persisted entity updates and version history but wrote no change_event
row, so Get Schema Changes alerts never fired on metadata ingestion, and no ingestion-driven update
was auditable. EntityUpdater.updateWithDeferredStore() (the bulk path) ran updateInternal() without
the captureIncrementalFromCurrentChange() step its three sibling entry points run, leaving
incrementalChangeDescription null, which incrementalFieldsChanged() reads as "nothing changed".
Every bulk update was therefore classified ENTITY_NO_CHANGE and dropped by
buildChangeEventJsonForBulkOperation.

Full analysis, blast radius and manual-test tables are in #32350.

This did not reach 1.13 automatically: #32350 merged without the To release label, and that
workflow no longer targets 1.13 in any case.

Type of change:

  • Bug fix

High-level design:

Two commits.

  1. git cherry-pick -x a3e5f5f4b030c818f8a52b0bb99eab46a94d13e3, with one conflict resolved.
    1.13 does not have private boolean entityStored = false; (introduced by perf: one-transaction flush + async indexing write path, read-path fixes #28675, never
    backported). That line is context for the new javadoc hunk, not something Fixes #32092: emit ChangeEvents for bulk entity updates #32350 adds, so the
    resolution drops it and keeps only the javadoc. Verified rather than eyeballed: the added and
    removed lines of this commit are byte-identical to the main commit's, and
    BulkChangeEventIT.java is byte-identical to the file on main.

  2. test: add the BulkApi harness helper required by BulkChangeEventIT on 1.13.
    openmetadata-integration-tests/.../it/util/BulkApi.java does not exist on 1.13 (it came in with
    Improve bulk endpoints for ingestion #28155 and fix(drive): add deleteStale endpoint and set File column FQNs on write #31375, neither backported), so the test would not compile. Added as a separate commit
    so it reads as a test-harness prerequisite rather than part of the fix. It is main's file trimmed
    to the two methods BulkChangeEventIT actually calls, botToken() and
    upsert(collection, requests, overrideMetadata, token). The deleteStale* helpers are omitted
    because they need BulkDeleteStaleRequest, a schema that does not exist on 1.13.

    ?overrideMetadata= is a no-op here: 1.13's bulkCreateOrUpdate does not declare the query
    param, JAX-RS ignores unknown params, and every call site passes false.

Everything else the test needs is already present and signature-compatible on 1.13:
DatabaseSchemaTestFactory.createSimple, DatabaseServiceTestFactory.createPostgres,
SdkClients.{adminClient,getAdminToken,getServerUrl}, JwtAuthProvider.tokenFor,
RequestOptions.builder().queryParams, executeForString, eventSubscriptions(), ListResponse
and BulkOperationResult.

The companion 2.0 backport is #32535.

Tests:

Backend integration tests

  • BulkChangeEventIT (6 cases), brought over unchanged.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Built and ran locally on this branch, all 11 modules from source in-reactor so the test exercises
this code and not a cached artifact:

mvn -pl openmetadata-integration-tests -am package -Dtest=BulkChangeEventIT
-> Tests run: 6, Failures: 0, Errors: 0, Skipped: 0

spotless:check on openmetadata-service and openmetadata-integration-tests is green.

Negative control on this branch. Since the fix hunk had to be conflict-resolved here, I rebuilt
1.13 with only the captureIncrementalFromCurrentChange() call removed and re-ran the suite:

Tests run: 6, Failures: 0, Errors: 4, Skipped: 0
  test_bulkColumnAdd_emitsEntityUpdatedChangeEvent   ConditionTimeout ... was null
  test_bulkColumnAdd_triggersSchemaChangeAlert       alert must count the bulk-produced change event
  test_bulkUndeleteViaBulkPut_emitsEvent             ConditionTimeout ... was null
  test_bulkUpdate_matchesSingleEntityPut             ConditionTimeout ... was null

Same 4-of-6 signature reported on main in #32350, so the resolved hunk is the load-bearing one on
1.13 and the two no-op cases correctly pass either way. The tree was restored afterwards.

Notes for reviewers

Carried over from #32350 and still applicable on 1.13:

  • Expect more change_event rows. This restores pre-1.13 volume for ingestion updates, bounded by
    the existing DataRetention app. Customers who created alerts while the bug was live have not seen
    this traffic before. Worth a release note.
  • Bulk-PUT of a soft-deleted entity now emits an event, consistent with the single-PUT path.
  • The recursive delete/restore cascade still emits one event, not N. Deliberate, documented in
    persistBulkUpdaters(), and shares updateWithDeferredStore() with this fix.

Checklist:

  • I have read the CONTRIBUTING document.
  • For JSON Schema changes: not applicable, no schema changes.
  • For UI changes: not applicable, no UI changes.
  • I have added a test that covers the exact scenario we are fixing.

On skip-pr-checks: a PR whose base is not the default branch cannot create GitHub's native closingIssuesReferences link, so the metadata gate has no way to see the linked issue and can never be satisfied here. The issue is #32092, already closed by #32350.

* Fixes #32092: emit ChangeEvents for bulk entity updates

* refactor: single-source EntityUpdater change-type classification

* test: cover ChangeEvent emission on the bulk entity update path

(cherry picked from commit a3e5f5f)
@manerow
manerow requested a review from a team as a code owner September 3, 2026 08:15
@manerow manerow added safe to test Add this label to run secure Github workflows on PRs backend labels Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 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 skip-pr-checks Bypass PR metadata validation check 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 3, 2026
@manerow
manerow force-pushed the backport/32350-1.13 branch from e8c3027 to b3d32dd Compare September 3, 2026 08:25
@gitar-bot

gitar-bot Bot commented Sep 3, 2026

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

Backport of #32350 to 1.13 that restores ChangeEvent emission for bulk entity updates by adding the missing captureIncrementalFromCurrentChange() call in the bulk path. Includes the BulkApi test harness helper (trimmed to only what BulkChangeEventIT requires) and passes all 6 test cases. No issues found.

✅ 1 resolved
✅ Quality: Unused 2-arg BulkApi.upsert overload is dead code

📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/util/BulkApi.java:34-37
BulkApi.upsert(String, List<?>) at lines 34-37 is never called — every call site in BulkChangeEventIT uses the 4-arg overload, and the PR description states the harness was trimmed to only the methods the test actually calls (botToken and the 4-arg upsert). Remove the unused 2-arg overload to match the stated intent and avoid carrying dead harness code.

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

This branch was previously deployed

1 inactive deployment
test — b3d32dd2 Deployed Sep 3, 2026 by manerow via playwright-ci-postgresql (6, 6) #78809
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