Skip to content

Fix the 2026-12-01 nightly reds: SDK field removal, ontology scratch schema, stale and slow ITs - #39394

Merged
mohityadav766 merged 12 commits into
mainfrom
fix/nightly-it-reds
Dec 2, 2026
Merged

mohityadav766 merged 12 commits into
mainfrom
fix/nightly-it-reds

Conversation

@mohityadav766

@mohityadav766 mohityadav766 commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes the reds of the 2026-12-01 backend nightly (run 46553147189). That was the first nightly with Java integration lanes, which #38801 added on 11-30, so some of these failures were latent on main rather than new.

Failure Cause Fix
OntologyEntityDAOIT: 5 tests, global-state lane, all 3 setups The approval rules read bot_entity since #38797. The test's scratch schema had no such table, so every write got "Approval rules are unavailable". Create bot_entity in OntologyTestDatabase.
ClassificationResourceIT, GlossaryTermResourceIT, EventSubscriptionResourceIT: a field set to null on update stays set SDK regression from #39164. With no get() snapshot, update() pruned the baseline to the submitted fields. A field nulled on an entity returned by create()/update() was therefore never removed. EntityServiceBase.update prunes only hand-built partial entities, which carry no version/updatedAt. Server-returned entities diff in full, as they did before #39164.
ContextMemoryAnchorIT: 2 tests #38011 lets a memory-only search return anchored memories that a reader may read. It left one assertion on the old rule. The "all" assertions also counted fuzzy-matched tables, and queried question, which "all" does not search. Align that assertion. Count only the contextMemory bucket. Carry the query in displayName, and confirm with an admin baseline search.
GlossaryTermApprovedTaggingIT: MySQL deadlock Deadlock in the bulk asset removal's DELETE FROM tag_usage. Run dropPendingOn through DeadlockRetry. Each chunk is an idempotent DELETE that commits on its own, with no enclosing transaction.
OntologyGovernanceIT: 429 By design, the single SPARQL worker queues a waiter for at most 5 s, then refuses it with 429 and Retry-After: 1 (ADR 2026-11-04-ontology-sparql-runs-in-a-bounded-worker, v3). On a loaded runner the first query can outlast that window. The test assumed both concurrent requests always get 200. The test retries a 429 after Retry-After, for up to 25 s, as a client should.
ConceptContextIT: timeout The workflow starts only once the serial WorkflowEventConsumer reaches the create event. On the nightly it was working through a backlog of concurrent tests' metric-entityCreated signals at about 1–3 per second. The test's metric was created at 02:11:25.4 and its signal was handled at about 02:11:55.5, 0.4 s past the 30 s limit. Wait 5 min, as MetricResourceIT already does. Consumer throughput under load is worth its own issue.

The Python reds (Informix test, airflow-apis uv.lock) were fixed identically by #39396.

Not in this PR: Java Sonar fails with Not authorized. The SONAR_TOKEN repo secret dates from 2021-12-23 and needs rotation by a SonarCloud admin.

Type of change:

  • Bug fix

High-level design:

N/A. These are targeted fixes, and each commit stands alone.

Tests:

Use cases covered

  • An SDK caller who clears a field on an entity returned by create() and calls update() gets the field removed. A hand-built partial entity still leaves unsent fields alone.
  • The ontology review flow works against the scratch schema.

Unit tests

  • UpdatePruneBaselineTest.updateWithoutSnapshotRemovesAFieldClearedOnAServerReturnedEntity. It fails without the fix, and the full openmetadata-sdk unit suite passes (443 tests).

Integration tests

  • Run locally on MySQL + Elasticsearch and on PostgreSQL + OpenSearch. All pass on both:
    • OntologyEntityDAOIT: 12/12.
    • ClassificationResourceIT#test_deleteAutoClassificationConfig, GlossaryTermResourceIT#patch_addDeleteStyle, EventSubscriptionResourceIT#test_updateSubscriptionRemoveTemplate.
    • SpreadsheetDetachedUpdateIT: 3/3, the Fixes #39129: prune no-snapshot update baseline to stop spurious JSON Patch removes #39164 regression IT.
    • ContextMemoryAnchorIT: 15/15.
    • GlossaryTermApprovedTaggingIT: 33/33.
    • OntologyGovernanceIT: 7/7.
    • ConceptContextIT: 22/22.
  • ci-merge-queue dispatched on this branch with workload=java: run 46650486049.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> (no tracking issue yet)
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: N/A, no schema changes.

🤖 Generated with Claude Code

#39164 pruned the no-snapshot baseline to the fields the caller sent, so a field
nulled on an entity returned by create() or update() was never removed. Prune only
hand-built partial entities, which carry no version or updatedAt.
…hema

Approval rules read bot_entity since #38797. Without it the gate refused every
write with "Approval rules are unavailable".
…arch

#38011 lets a memory-only search return anchored memories a reader may read, but
left one assertion on the old rule. The "all" assertions counted fuzzy-matched
tables and queried the question, which "all" does not search; count memories only
and carry the query in the display name.
…n deadlock

The chunked DELETE on tag_usage commits on its own and is idempotent, so
DeadlockRetry can rerun it.
Retry a SPARQL request the single worker turns away with 429, and give the
approval workflow the 5 minutes MetricResourceIT already allows.
PerSourceState is owned by each source instance, so a second run starts empty
and the object has no clear().
@mohityadav766
mohityadav766 requested review from a team as code owners December 1, 2026 09:03
@mohityadav766
mohityadav766 requested review from IceS2 and stout-yeoman and removed request for a team December 1, 2026 09:03
@github-actions

github-actions Bot commented Dec 1, 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.

mohityadav766 and others added 5 commits December 1, 2026 17:51
The bounded worker answers saturation with 429 and Retry-After by design, so the
client waits as told. The approval workflow starts only when the serial
WorkflowEventConsumer reaches the create event, which lags under parallel load.
…n update()

Replace the sleep loop with Awaitility at the server's Retry-After interval.
Add a test that a server-returned entity with one changed field emits no
remove ops.
@mohityadav766

Copy link
Copy Markdown
Member Author

On the medium-risk note, that absent fields on server-returned entities now become removes:

  • Scope. Only entities that carry version and updatedAt, which means objects the server returned, get the full diff. That is exactly what update() did for every no-snapshot call before Fixes #39129: prune no-snapshot update baseline to stop spurious JSON Patch removes #39164. Hand-built partial entities keep Fixes #39129: prune no-snapshot update baseline to stop spurious JSON Patch removes #39164's pruning, so they still send no removes for fields they leave out (UpdatePruneBaselineTest, SpreadsheetDetachedUpdateIT).
  • Why the full diff is needed. For a server-returned entity, a missing field is the only signal that the caller cleared it, because nulls are not serialized. Pruning it is what broke the three ITs in the nightly.
  • Guard against the scenario you describe. b6c84a4 adds updateWithoutSnapshotKeepsUntouchedFieldsOfAServerReturnedEntity: a server-returned entity with one changed field sends no remove ops.
  • Breadth. The ci-merge-queue Java run on this branch (46650486049) drives this path through nearly every patchEntity in about 20k ITs per setup. All IT failures and errors were unrelated: a fork timeout on PG+ES+Redis with 0 failures, the 65 min lane cap on PG+OS, and one OntologyConceptQueryIT deadlock on MySQL.

@gitar-bot

gitar-bot Bot commented Dec 1, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findings

The shared SDK now emits removals for absent fields on versioned server entities, so callers omitting fields could unintentionally delete persisted metadata.

Fixes the 2026-12-01 nightly reds by adding bot_entity to the ontology scratch schema, restoring field-null removal in EntityServiceBase.update for server-returned entities, aligning ContextMemoryAnchorIT with memory-only search, retrying the bulk asset removal's DELETE FROM tag_usage on deadlock, retrying SPARQL 429 responses in OntologyGovernanceIT, and extending the ConceptContextIT workflow wait.

The new 429 retry loop in askTogether that used Thread.sleep in a test was addressed, and no open issues remain.

✅ 1 closed
✅ Quality: New 429 retry loop in askTogether uses Thread.sleep in a test

📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/OntologyGovernanceIT.java:300-306
The new retry in askTogether waits with a hand-written while loop and Thread.sleep(250) until a deadline. The backend testing rule says tests must never use Thread.sleep() and should use condition-based waiting or Awaitility instead. This class already gets the same kind of polling from Awaitility, and switching to it removes the manual nanoTime deadline. The fix below keeps the 25 s budget and the 250 ms poll interval, and still returns the last response, so a lasting 429 still reaches the assertion.

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

@mohityadav766
mohityadav766 merged commit 861f68a into main Dec 2, 2026
24 of 25 checks passed
@mohityadav766
mohityadav766 deleted the fix/nightly-it-reds branch December 2, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants