Repository navigation
fix(it): read the promoted Fuseki dataset after a blue/green rebuild - #35797
Conversation
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.
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 VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
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 alwaysRdfInferenceMaterializationIT.persistsInvalidatesMaterializesAndClearsCustomRules, atassertSuccessfulMaterialization: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 fromopenmetadatatoopenmetadata_a. It stays there for the rest of the suite:RdfDatasetNames.alternatecycles_a ↔ _band never returns to the base name, and the class's@AfterEach restoreSuiteRdf()only re-initialisesRdfUpdater.RdfTestUtils.executeSparqlAsk/Selectquery Fuseki directly at the fixedTestSuiteBootstrap.getFusekiQueryEndpoint()(…/openmetadata/sparql). Any class that runs afterwards therefore reads a stale dataset. The materialization succeeds (tripleCount = 1, written toopenmetadata_a), and the direct ASK againstopenmetadatareturns 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), asRdfInferenceMaterializationIThas) 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:RdfOntologyActivationITfirst:424RdfInferenceMaterializationITfirstFix (test infrastructure only).
TestSuiteBootstrap.getFusekiQueryEndpoint/UpdateEndpoint/DataEndpointnow 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 buildRdfConfiguration. Fuseki's shiro config already allows anonymous reads on/openmetadata_a/sparqland/openmetadata_b/sparql.RdfOntologyActivationITnow ends with a direct-store assertion. It reads, straight from Fuseki, a triple that exists only in the promoted dataset (the staleopenmetadatacopy still holds the second release'ssubClassOf 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):
RdfSqlResourceIThappy-path tests time out or return 400 because the shared IT JVM hitsOutOfMemoryError: Java heap spaceinJenaFusekiStorage.doExecuteSparqlQuery. That method buffers the whole result ofSELECT name, description FROM tables(noLIMIT) into aByteArrayOutputStreambefore callingtoString. That needs its own fix.Type of change:
Tests:
Use cases covered
RdfTestUtilssee the promoted dataset.RdfInferenceMaterializationITpasses when it runs afterRdfOntologyActivationIT.Unit tests
Backend integration tests
Local runs of the rdf lane on MySQL + Elasticsearch, with only these two classes.
-Dfailsafe.runOrder=reversealphabeticalforces the order that fails in CI (activation first):main'sTestSuiteBootstrap, plus the new assertion):Tests run: 18, Failures: 2. These wereRdfOntologyActivationIT.java:131(the new direct-store assertion) andRdfInferenceMaterializationIT.java:424, the same failure as CI.Tests run: 18, Failures: 0, Errors: 0.RdfOntologyActivationIT2/2 andRdfInferenceMaterializationIT16/16, BUILD SUCCESS.Ingestion integration tests
Playwright (UI) tests
Manual testing performed
Checklist:
mvn spotless:applyand pre-commit passed.skip-pr-checks, following the author's convention for CI fixes.