Skip to content

fix(it): read the promoted Fuseki dataset after a blue/green rebuild - #35797

Merged
mohityadav766 merged 1 commit into
mainfrom
pmbrull/pr-errors-check
Oct 20, 2026
Merged

mohityadav766 merged 1 commit into
mainfrom
pmbrull/pr-errors-check

Conversation

@pmbrull

@pmbrull pmbrull commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

The rdf IT lane has failed on roughly one in six merge-queue runs since #35672, for whichever PR happens to be queued (#35711, #35652, #35774, #35768, #35787, and a push to main). The failing test is always RdfInferenceMaterializationIT.persistsInvalidatesMaterializesAndClearsCustomRules, at assertSuccessfulMaterialization:424 (assertTrue(hasInferredTriple(fixture)), "expected: but was: "), on both MySQL + Elasticsearch and PostgreSQL + OpenSearch.

Root cause. RdfOntologyActivationIT.activationRollbackAndArchiveSurviveRebuildingTheServingDataset (added in #35672) runs a real blue/green rebuild on the shared IT server: beginBlueGreenRebuild() → activateDataset(). The durable serving pointer (rdf_active_dataset) moves from openmetadata to openmetadata_a. It stays there for the rest of the suite: RdfDatasetNames.alternate cycles _a ↔ _b and never returns to the base name, and the class's @AfterEach restoreSuiteRdf() only re-initialises RdfUpdater. RdfTestUtils.executeSparqlAsk/Select query Fuseki directly at the fixed TestSuiteBootstrap.getFusekiQueryEndpoint() (…/openmetadata/sparql). Any class that runs afterwards therefore reads a stale dataset. The materialization succeeds (tripleCount = 1, written to openmetadata_a), and the direct ASK against openmetadata returns false.

Why it is order-dependent. JUnit defers every class that holds the global read-write lock (@Isolated, or any method with @ResourceLock(GLOBAL, READ_WRITE), as RdfInferenceMaterializationIT has) until all concurrent classes finish. It then runs them one at a time in discovery order, and failsafe discovers classes in filesystem order. Across 112 rdf-lane runs from 2026-10-18 to 2026-10-20:

Order of the two classes Runs Result
RdfOntologyActivationIT first 19 19 failed, all at :424
RdfInferenceMaterializationIT first 93 93 passed

Fix (test infrastructure only).

  • TestSuiteBootstrap.getFusekiQueryEndpoint/UpdateEndpoint/DataEndpoint now address the dataset the server is serving: RdfRepository.activeDatasetName(), resolved against the configured Fuseki URL. getFusekiEndpoint() still returns the configured endpoint, which classes use to build RdfConfiguration. Fuseki's shiro config already allows anonymous reads on /openmetadata_a/sparql and /openmetadata_b/sparql.
  • RdfOntologyActivationIT now ends with a direct-store assertion. It reads, straight from Fuseki, a triple that exists only in the promoted dataset (the stale openmetadata copy still holds the second release's subClassOf LegalEntity). This makes the regression deterministic and independent of class order.

Not in scope, but seen in 12 of the same 19 failing runs (and in none of the passing ones): RdfSqlResourceIT happy-path tests time out or return 400 because the shared IT JVM hits OutOfMemoryError: Java heap space in JenaFusekiStorage.doExecuteSparqlQuery. That method buffers the whole result of SELECT name, description FROM tables (no LIMIT) into a ByteArrayOutputStream before calling toString. That needs its own fix.

Type of change:

  • Bug fix

Tests:

Use cases covered

  • After a blue/green promotion of the shared server, direct Fuseki reads in RdfTestUtils see the promoted dataset.
  • RdfInferenceMaterializationIT passes when it runs after RdfOntologyActivationIT.

Unit tests

  • Not applicable: test-infrastructure change only.

Backend integration tests

Local runs of the rdf lane on MySQL + Elasticsearch, with only these two classes. -Dfailsafe.runOrder=reversealphabetical forces the order that fails in CI (activation first):

mvn -B verify -pl :openmetadata-integration-tests -Dspring-boot.repackage.skip=true \
  -Pmysql-elasticsearch -DintegrationTests.lane=rdf \
  -Dit.test=RdfOntologyActivationIT,RdfInferenceMaterializationIT -Dfailsafe.runOrder=reversealphabetical \
  -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • RED (main's TestSuiteBootstrap, plus the new assertion): Tests run: 18, Failures: 2. These were RdfOntologyActivationIT.java:131 (the new direct-store assertion) and RdfInferenceMaterializationIT.java:424, the same failure as CI.
  • GREEN (this PR): same order, Tests run: 18, Failures: 0, Errors: 0. RdfOntologyActivationIT 2/2 and RdfInferenceMaterializationIT 16/16, BUILD SUCCESS.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Checklist:

  • I have added a test that covers the exact scenario we are fixing.
  • mvn spotless:apply and pre-commit passed.
  • No linked issue: skip-pr-checks, following the author's convention for CI fixes.

RdfOntologyActivationIT promotes the shared server's RDF serving dataset to
openmetadata_a, and the durable pointer stays there for the rest of the suite
(dataset alternates never return to the base name). RdfTestUtils queried the
configured /openmetadata dataset directly, so a class scheduled after it read
a stale copy: RdfInferenceMaterializationIT failed at hasInferredTriple
whenever it ran second. Since #35672, 19 of 19 failing rdf-lane runs had that
order and 93 of 93 passing runs had the reverse.

The direct store endpoints now follow the serving pointer, and the activation
test asserts that a direct read sees content only the promoted dataset holds.
@pmbrull pmbrull added safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Oct 20, 2026
@gitar-bot

gitar-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Redirecting integration-test Fuseki query, update, and data endpoints to the active dataset could send test operations to a different dataset after promotion.

Test-infrastructure fix so RdfTestUtils and TestSuiteBootstrap read the Fuseki dataset the server is actually serving after a blue/green rebuild, and RdfOntologyActivationIT gains a direct-store assertion. This removes the order-dependent failure in RdfInferenceMaterializationIT. 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

@pmbrull
pmbrull enabled auto-merge October 20, 2026 13:07
@mohityadav766
mohityadav766 added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 63bb57d Oct 20, 2026
124 of 125 checks passed
@mohityadav766
mohityadav766 deleted the pmbrull/pr-errors-check branch October 20, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion 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