Skip to content

Fixes #36671: Live RDF entity writes send only the changed triples - #37069

Merged
fmcardoso merged 8 commits into
mainfrom
fmcardoso/reduce-fuseki-disk-growth-by-writing-only-change
Nov 5, 2026
Merged

fmcardoso merged 8 commits into
mainfrom
fmcardoso/reduce-fuseki-disk-growth-by-writing-only-change

Conversation

@fmcardoso

@fmcardoso fmcardoso commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #36671

Every live entity write deleted the entity's whole projection and inserted it again, even when nothing had changed. TDB2 copies every index page a write touches, so a nightly ingestion of wide tables grew Fuseki's volume by tens of GB between compactions (#36437 added the compaction; this removes most of the growth it has to reclaim). RDF lists were blank nodes no write could name, so every rewrite also leaked the previous list's cells.

Live entity writes now read the triples a full replacement would delete, compare them with the new projection, and send one DELETE DATA / INSERT DATA request with only the difference, or nothing at all. Decision record: docs/decisions/2026-11-03-live-rdf-entity-writes-send-only-the-changed-triples.md.

Type of change:

  • Bug fix

High-level design:

Write path. RdfStorageInterface.storeEntity(type, id, model, strategy) returns an RdfEntityWriteResult (UNCHANGED, CHANGED_TRIPLES, REPLACED, CORRECTED). In JenaFusekiStorage, RdfEntityWritePlanner decides what to send:

  • It reads the stored scope with one CONSTRUCT. RdfEntityScope builds it from the same pattern the existing replacement deletes, so the two cannot drift. The scope is the entity's literals, the IRI values of translator-managed predicates, and its owned resources: custom properties, extensions, columns and nested columns, list cells.
  • RdfEntityDifference: triples to delete = stored − projection; to insert = projection − stored − already present. Projection triples outside the scope (tag labels, referenced entities' types) are only inserted when missing, checked in bounded reads of 1,000. Literals with the same datatype, language and value count as equal, because TDB2 can return dates and decimals in another lexical form.
  • It falls back to today's full replacement (RdfEntityWriteStrategy.REPLACE) when the projection or the store holds a blank node, or when the difference is larger than the projection (e.g. a rename).

Unchanged writes cost nothing downstream. InferenceInvalidatingRdfStorage and AssertedGraphTrackingRdfStorage only invalidate when result.changesGraph(). RebuildingRdfStorage passes the result through; the rebuild journal still records the full projection.

Lists. RdfPropertyMapper names list cells <entity>/list/<URL-encoded predicate>/<index> (rdf:nil for an empty list). RdfOwnedResources owns them, so entity deletes and bulk reconcile remove them too. A list still stored with blank cells is replaced once, cells included.

Writes that interfere (the one real hazard of read-then-write). A difference is computed from a read. A write already queued for TDB2's writer when that read ran commits between the read and our update: a request OpenMetadata stopped waiting for after its 60 s deadline, a timed-out reconcile-reindex chunk, or the request of a server that died. A full replacement queued behind it would correct it; a bare difference would leave a mixed graph, e.g. the queued write's description next to ours. So after sending a difference, RdfEntityWritePlanner.write reads the projection back, and sends the full replacement if it differs (outcome corrected):

  • TDB2 admits writers in arrival order (new Semaphore(1, true) in Jena 6.2.0's TransactionCoordinator, the version in our Fuseki image). Once our update has returned, every write queued ahead of it has committed, so the read-back sees all of them.
  • It covers every writer the same way, with no queue state, so restarts, other servers and rolling upgrades need nothing extra.
  • It costs one extra read per changed write. Unchanged writes send nothing, and reads don't grow TDB2's files.
  • rdf.fuseki.entity.writes{outcome=corrected} shows how often it happens; it should only appear while Fuseki is timing out.

The remaining limits are in the decision record: a stale write sent after ours (as on main), an unchanged write followed by a stale write still queued, and the unordered moment right after a compaction ends.

Alternatives rejected.

  • Retrying failed queue writes as a full replacement (this PR's first version, flagged by both reviewers): it missed crashes, older servers during a rolling upgrade, other writers such as reindex chunks, and the next queue row for the same entity. The read-back covers all of them, so that machinery was removed.
  • A per-entity write token with a conditional update: the same safety, but it adds a triple to every entity and still needs the read-back to detect a skipped update.
  • An "uncertain until" window, in memory or in a new column: it doesn't cover other servers, or it needs a migration, and it depends on a timing guess.

Unchanged: bulk reindex (INSERT_ONLY), relationship writes, the rebuild journal (journal replay now passes REPLACE explicitly, as it did before).

Compatibility.

  • No schema or migration change.
  • During a rolling upgrade an older server can still fully rewrite an entity. It doesn't know the named list cells, so cells of a list it replaces stay until a reindex.
  • Turtle and RDF/XML exports (GET /v1/rdf/entity/{type}/{id}) show a list as named rdf:first/rdf:rest resources instead of a ( … ) collection. The graph means the same, SPARQL list paths still match, and JSON-LD export is unaffected.
  • Orphans from before this change (blank list cells, unowned resources) are removed by a successful recreateIndex: true reindex.
  • Cleaning up stale resources an entity emits but does not own (lifecycle, table constraints, profile measurements, pipeline runs, datasetByFqn) stays out of scope, as before, and is listed as a follow-up in the decision record.

Release. This targets main and is labelled 2.1. Note that the 2.1 branch does not contain the #36437 maintenance work this builds on (its backport #36473 was closed unmerged), while 2.0 does (#36660, #36661).

Measured with scripts/rdf-live-update-benchmark.sh (new): 200 tables × 300 columns, 1,000 writes per scenario, one openmetadata/fuseki:6.2.0-c75b095 container. Disk is the dataset directory's growth.

Scenario Replace: disk / write Difference: disk / write Update requests Payload
Unchanged 20.8 MB 0 1000 → 0 344 MB → 0
One column tag moved 20.7 MB 173 KB 1000 → 1000 344 MB → 0.5 MB
New description 20.8 MB 184 KB 1000 → 1000 344 MB → 0.4 MB

The difference column was rerun at f95b681287b, read-back included: it added no update requests, and no write came back corrected. The synthetic tables are wider than typical (every column has a description), so the ratio is the meaningful number. New metrics to watch: rdf.fuseki.entity.writes{outcome}, rdf.fuseki.entity.triples{change}, rdf.fuseki.payload.bytes{operation=storeEntity}.

Tests:

Use cases covered

  • An unchanged projection sends no update and no inference invalidation; against real Fuseki, a second delivery adds no update request.
  • One tag change on a 200-column table deletes exactly one triple and sends a small update.
  • Successive versions (added, removed, renamed and nested columns, extensions, lists growing, shrinking, emptying and disappearing) end in the same graph a full replacement leaves. Relationships (om:upstream, om:downstream, om:contains, om:owns) survive.
  • Literals the store returns in canonical form count as unchanged.
  • A list stored with blank cells is replaced once, with its cells.
  • Fallbacks: blank nodes, a difference larger than the projection, and the existence check read in bounded chunks.
  • A write that commits between a difference's read and its update is replaced away (outcome corrected); a changed write nobody interfered with is not replaced.
  • A successful read for an unchanged write closes the circuit breaker again.
  • An entity write that fails after it may have committed (e.g. its read-back times out) still marks inference stale, because its retry reports nothing changed.
  • Journal replay replaces, as before.

Unit tests

  • I added unit tests for the new/changed logic.
  • Added:
    • RdfEntityWritePlannerTest: the generated SPARQL runs against an in-memory Jena dataset and is compared with a full replacement.
    • RdfOwnedResourcesTest: the Java owned-resource walk matches the SPARQL scope.
    • EntityWriteCircuitBreakerTest.
    • RdfMutationReplayTest: journal replay replaces.
  • Updated: InferenceInvalidatingRdfStorageTest (an unchanged write leaves rules clean; a failed one marks them dirty), AssertedGraphTrackingRdfStorageTest.
  • Coverage %: JaCoCo line coverage (-Pstatic-code-analysis, 112 targeted unit tests at f95b681287b) on the new classes:
    • 100%: RdfEntityWritePlanner (read-back included), RdfEntityDifference, RdfEntityWriteResult, RdfEntityWriteStrategy, RdfOwnedResources.
    • 96%: RdfEntityScope.
    • Touched existing classes are large, so their whole-class numbers say little about the changed lines: RdfPropertyMapper 86%, InferenceInvalidatingRdfStorage 45%, JenaFusekiStorage 38%. The changed storeEntity path runs against real Fuseki in RdfEntityDiffWriteIT.

Backend integration tests

  • Added RdfEntityDiffWriteIT. It starts its own Fuseki and counts update requests from Fuseki's /$/stats. It writes the same versions through the difference path and the replacement path into two datasets and compares the graphs.
  • Updated RdfBlueGreenRebuildIT (its fault-injecting storage forwards the new storeEntity).

Local Java test run: PASSED

  • Commit: f95b681287bc (base origin/main); the only later commit, a66a8986f26, changes the decision record only.
  • Finished: 2026-11-04 15:47 UTC · 28.5 min
Step Scope Classes Tests Failed Skipped Min Result
unit openmetadata-service (34 classes) 34 323 0 0 2.2 passed
integration mysql-elasticsearch · parallel 59 1980 0 152 7.5 passed
integration mysql-elasticsearch · isolated 1 16 0 0 4.3 passed
integration mysql-elasticsearch · rdf 33 325 0 1 14.5 passed

Every test skipped, so these exercised nothing (check their assumptions — usually the engine): BaseEntityIT$ListEntityHistoryByTimestampPaginationTest (mysql-elasticsearch · parallel), RdfIndexAppScaleIT (mysql-elasticsearch · rdf)

  • Impacted, not run locally: 2 classes (listed in the details)

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  1. Started a throwaway Fuseki:
    docker run -d --name om-fuseki-bench -p 3031:3030 -e ADMIN_PASSWORD=bench -e FUSEKI_DATASETS=openmetadata -e FUSEKI_UNION_DEFAULT_GRAPH=true -e FUSEKI_QUERY_TIMEOUT_MS=50000 -e FUSEKI_UPDATE_TIMEOUT_MS=50000 -e OPENMETADATA_EXTENSION_ENABLED=true openmetadata/fuseki:6.2.0-c75b095
    
  2. Ran FUSEKI_ENDPOINT=http://localhost:3031/openmetadata FUSEKI_PASSWORD=bench bash scripts/rdf-live-update-benchmark.sh (REPLACE then DIFFERENCE, compacting before each scenario). Results are in the table above.
  3. Checked that /$/stats/openmetadata reports endpoints keyed by operation: "update" with Requests, which the IT and the harness parse.

UI screen recording:

Not applicable — backend-only change with no UI.

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation>

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. Not applicable: no schema change.

  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable). Not applicable: backend only.

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.

    • Earlier passes: fresh-context reviews of 8e8904aaa33 and 270082486ed found no 🔴. Their 🟡 were fixed in 270082486ed and a58bad35002: the circuit breaker on entity-write reads, test hardening, an unreachable guard.
    • PR reviews by two models (Opus 5.5 and GPT 6.1) found the read-then-write race described under "Writes that interfere". Fixed in f46173a9fda by the read-back, which replaced the queue-based redelivery rule.
    • Fresh-context pass on f46173a9fda:
      • 🔴 A difference that commits and then fails its read-back would never refresh inference. Fixed in f95b681287b, with a test that fails without it.
      • 🟡 Fixed: the RdfEntityWriteStrategy Javadoc, and a test pinning journal replay to REPLACE.
      • 🟡 Answered: no test pins TDB2's arrival-order admission. TDB2 isn't on any test module's classpath, and the TDB2 that matters runs inside the Fuseki image, pinned by its tag, so a test against our own Jena wouldn't test it. The decision record says to revisit on a Jena or image upgrade.
  • Decision check: if this PR decides something the next contributor could undo — a schema field, REST path or format another component or repo must agree with, a new default or limit, an ordering that must hold, or a rule stated only in this description — it adds a record under docs/decisions/ (see its README.md). This description is gone from git log after the squash-merge. Added docs/decisions/2026-11-03-live-rdf-entity-writes-send-only-the-changed-triples.md.

  • I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference.

🤖 Generated with Claude Code

Every live entity write deleted and reinserted the entity's whole projection,
so each wide-table write copied TDB2 index pages even when nothing changed.
storeEntity now reads the triples a replacement would delete, compares them
with the new projection, and sends one DELETE DATA / INSERT DATA request with
only the difference, or nothing. Literals compare by datatype and value.

- Unchanged writes no longer mark inference dirty or relist asserted graphs.
- Writes fall back to a full replacement for blank nodes, for a difference
  larger than the projection, and for a queued write whose earlier attempt
  failed or was held by compaction (it may still apply in Fuseki).
- RDF list cells get stable IRIs owned by the entity, so replaced lists no
  longer leak cells.
- ADR, production docs, unit tests, a real-Fuseki IT and a disk benchmark.
…ry wiring

- A successful read for an entity write records a success with the circuit
  breaker; an unchanged write sends no update, so occasional read timeouts
  otherwise add up across unchanged writes and trip it.
- RdfUpdater.liveWriteApplication is extracted so a test can show a
  redelivered queue write reaches storage as REPLACE and a first attempt as
  DIFFERENCE; CompactionBlockedWriteTest checks the held write is pending.
- Drop the unreachable guard in createTypeResource: getRdfType never
  returns null or empty.
…rden its test

A changed write's success comes from its update, so its read no longer clears the breaker before the update counts its own failure. The test warms up first, allows 1 s per read and asserts each failure is a timeout.
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@fmcardoso

Copy link
Copy Markdown
Member Author

Local Java test run: PASSED — details

  • Commit: a58bad35002e (base origin/main)
  • The summary is in the PR description.

Every test skipped, so these exercised nothing (check their assumptions — usually the engine): RdfIndexAppScaleIT (mysql-elasticsearch · rdf)

Tests run locally

  • unit · openmetadata-mcp (7 classes), openmetadata-service (58 classes): 65 classes, 734 tests executed (listed below)
  • integration · mysql-elasticsearch · parallel: 82 classes, 2789 tests executed (listed below)
  • integration · mysql-elasticsearch · isolated: EntityShapeIT (312 passed), GlossaryOntologyExportIT (16 passed)
  • integration · mysql-elasticsearch · rdf: 33 classes, 326 tests executed (listed below)
  • integration · cache-tests · parallel: EntityCacheWriteOrderIT (1 passed)

Per-class counts come from the test reports, which can credit a test to the wrong class when classes run concurrently, and keep only the last run of a nested class that several test classes inherit. The summary's step totals are Maven's own counts.

unit · openmetadata-mcp (7 classes), openmetadata-service (58 classes): 109 classes

AgentSparqlServiceTest (23 passed), AssertedGraphTrackingRdfStorageTest (5 passed), CentralityComputationTest (0 passed), CentralityComputationTest$EndToEnd (6 passed), CentralityComputationTest$GraphParsing (6 passed), CentralityComputationTest$PredicateWeights (1 passed), CommunityComputationTest (0 passed), CommunityComputationTest$EndToEnd (6 passed), CommunityComputationTest$GraphParsing (6 passed), CommunityComputationTest$GraphTypeParsing (3 passed), CommunityComputationTest$WellFormed (4 passed), CompactionBlockedWriteTest (2 passed), EntityNeighborhoodToolTest (15 passed), EntityWriteCircuitBreakerTest (1 passed), FindByTagToolTest (15 passed), InferenceInvalidatingRdfStorageTest (3 passed), JenaFusekiDatasetAdminTest (17 passed), JenaFusekiStorageTest (0 passed), JenaFusekiStorageTest$ConfigurationDefaultTests (2 passed), JenaFusekiStorageTest$DatasetRedirectionTests (6 passed), JenaFusekiStorageTest$EncodePathSegmentTests (3 passed), JenaFusekiStorageTest$EntityUpsertQueryTests (5 passed), JenaFusekiStorageTest$GraphTripleCountQueryTests (2 passed), JenaFusekiStorageTest$MaskUserInfoTests (5 passed), JenaFusekiStorageTest$MetricsParsingTests (2 passed), JenaFusekiStorageTest$ParseDatasetEndpointTests (9 passed), JenaFusekiStorageTest$PayloadGuardTests (5 passed), JenaFusekiStorageTest$RelationshipReconciliationQueryTests (1 passed), JenaFusekiStorageTest$RequestTimeoutClassificationTests (2 passed), JenaFusekiStreamingAppendTest (4 passed), LineagePathFinderTest (0 passed), LineagePathFinderTest$EndToEnd (12 passed), LineagePathFinderTest$FrontierParsing (4 passed), LineagePathFinderTest$TypesParsing (2 passed), MetricGroupRepositoryTest (19 passed), OntologyActiveGraphStorageTest (4 passed), OntologyDescribeToolTest (12 passed), RdfAutoTuneTest (7 passed), RdfBatchProcessorTest (24 passed), RdfBlueGreenDatasetTest (0 passed), RdfBlueGreenDatasetTest$AlternationTests (3 passed), RdfBlueGreenDatasetTest$RepositoryRoutingTests (5 passed), RdfBulkSinkTest (9 passed), RdfCustomPropertyProjectionTest (5 passed), RdfEntityDeleteLineageTest (1 passed), RdfEntityWritePlannerTest (10 passed), RdfExtensionProjectionTest (2 passed), RdfGlossaryRelationCleanupQueryTest (1 passed), RdfGlossaryTermGraphFilterTest (6 passed), RdfGlossaryTermRelationTest (62 passed), RdfGraphHelpersTest (17 passed), RdfGraphServiceTest (9 passed), RdfIndexAppTest (0 passed), RdfIndexAppTest$AdmissionTests (3 passed), RdfIndexAppTest$BlueGreenLifecycleTests (6 passed), RdfIndexAppTest$EntityRelationshipConversionTests (3 passed), RdfIndexAppTest$EntitySelectionTests (5 passed), RdfIndexAppTest$InitializationTests (2 passed), RdfIndexAppTest$PromotionRatioGateTests (4 passed), RdfIndexAppTest$RunLockTests (4 passed), RdfIndexAppTest$RunRecordUpdateTests (10 passed), RdfIndexAppTest$StopFunctionalityTests (2 passed), RdfIndexAppTest$ValidationTests (1 passed), RdfIndexingFieldsTest (2 passed), RdfInferenceAppTest (1 passed), RdfInferenceGuardrailTest (9 passed), RdfInsightsServiceTest (11 passed), RdfJenaBootstrapTest (1 passed), RdfLineageBatchingTest (5 passed), RdfLineageOntologyTest (10 passed), RdfLiveWriteTest (21 passed), RdfLiveWriterTest (6 passed), RdfMutationUpdateShapeTest (3 passed), RdfOwnedResourcesTest (3 passed), RdfParserHelpersTest (6 passed), RdfPredicatePartitionTest (3 passed), RdfProjectionHealthTest (4 passed), RdfPropertyMapperTest (0 passed), RdfPropertyMapperTest$AddTypedPropertyBlankString (4 passed), RdfPropertyMapperTest$ChangeDescriptionTests (2 passed), RdfPropertyMapperTest$ColumnResourceTests (9 passed), RdfPropertyMapperTest$DedicatedMapperFieldTests (2 passed), RdfPropertyMapperTest$ExtensionTests (1 passed), RdfPropertyMapperTest$GeneralPropertyMappingTests (13 passed), RdfPropertyMapperTest$LifeCycleTests (1 passed), RdfPropertyMapperTest$LineageTests (3 passed), RdfPropertyMapperTest$TestCaseResultTests (1 passed), RdfPropertyMapperTest$TranslatorManagedPredicatesTests (2 passed), RdfPropertyMapperTest$VotesTests (1 passed), RdfReindexLabelLookupTest (1 passed), RdfRelationPredicateValidationTest (35 passed), RdfRepositoryBulkChunkingTest (11 passed), RdfRepositoryProjectionHealthTest (1 passed), RdfResourceTest (23 passed), RdfRuleInputProjectionTest (6 passed), RdfSparqlServiceTest (12 passed), RdfStorageIdempotencyTest (4 passed), RdfStorageMaintenanceExceptionMapperTest (1 passed), RdfStorageMaintenanceServiceTest (22 passed), RdfToolGatingTest (3 passed), RdfUpdaterTest (16 passed), RdfValidationServiceTest (6 passed), SerializedRdfPayloadTest (3 passed), ShaclValidateToolTest (9 passed), SparqlQueryToolAgentProfileTest (14 passed), SparqlQueryToolTest (14 passed), StorageFactsTest (2 passed), StorageGuardRefusalTest (3 passed), TestCaseRepositoryTest (11 passed)

integration · mysql-elasticsearch · parallel: 83 classes

BaseEntityIT$ListEntityHistoryByTimestampPaginationTest (15 passed, 1 skipped), ConfigResourceIT (12 passed), DatabaseResourceIT (107 passed, 6 skipped), DatabaseSmokeIT (15 passed, 2 skipped), EntityBulkCreateRecoveryIT (12 passed), EntityCacheInvalidationIT (10 passed), EntityCacheMemoryIT (2 passed), EntityCursorOffsetIT (27 passed, 3 skipped), EntityDeleteTaskCleanupIT (10 passed), EntityHardDeletionAtomicityIT (18 passed), EntityHistoryPaginationIT (10 passed), EntityLifecycleStagesIT (3 passed), EntityNameIndexIT (16 passed, 5 skipped), EntityProfileResourceIT (35 passed, 4 skipped), EntityRelationshipCleanupIT (20 passed, 2 skipped), EntityShapeBaselineIT (1 passed), EntityStatusWorkflowOwnershipIT (3 passed), EntitySubtreeAtomicityIT (2 passed), EntityTransactionBoundaryIT (4 passed), EntityUpdateLockOrderIT (8 passed), EntityUtilValidateEntityReferenceIT (16 passed), GlossaryRdfImportIT (5 passed), GlossaryTermRelationIT (0 passed), GlossaryTermResourceIT (58 passed, 1 skipped), IndependentOntologyActivationIT (18 passed, 1 skipped), IndependentOntologyApprovalIT (1 passed), IndependentOntologyAuthorizationIT (1 passed), IndependentOntologyAxiomIT (4 passed, 1 skipped), IndependentOntologyClassModelIT (17 passed, 6 skipped), IndependentOntologyHierarchyIT (13 passed, 1 skipped), IndependentOntologyInverseIT (3 passed), IndependentOntologyPublicationIT (5 passed), IndependentOntologyReferenceIT (18 passed), IndependentOntologyReleaseDiffIT (72 passed, 8 skipped), IndependentOntologyReleaseExportAssetsIT (4 passed), IndependentOntologyReleaseExportFormatsIT (4 passed, 4 skipped), IndependentOntologyReleaseExportGateIT (11 passed), IndependentOntologyReleaseExportIT (1 passed), IndependentOntologyReleaseIT (44 passed, 7 skipped), IndependentOntologyReleaseValidationIT (5 passed), IndependentOntologyResourceIT (41 passed, 4 skipped), IndependentOntologyRetentionIT (8 passed), IndependentOntologyReviewRecoveryIT (34 passed, 1 skipped), IndependentOntologyReviewRuleIT (13 passed), IndependentOntologyStatusIT (11 passed), IndependentOntologyWorkingDiffIT (16 passed, 1 skipped), McpRdfNotEnabledIT (27 passed, 2 skipped), MetricResourceIT (2 passed), NativeOntologyCsvInverseReimportIT (5 passed), NativeOntologyDataGraphBindingScanIT (3 passed), NativeOntologyDataGraphContextIT (5 passed), NativeOntologyDataGraphEdgeScanIT (4 passed), NativeOntologyDataGraphIT (5 passed), NativeOntologyDataGraphPageIT (6 passed), NativeOntologyImportIntoNewOntologyIT (2 passed), NativeOntologyImportListRulesIT (54 passed, 10 skipped), NativeOntologyImportPreviewIT (22 passed), NativeOntologyLibraryPreviewIT (8 passed), NativeOntologyMemoryIT (48 passed, 4 skipped), NativeOntologyPackInstallStateIT (12 passed), OntologyAiResourceIT (2 passed), OntologyAxiomResourceIT (2 passed), OntologyBulkIT (90 passed, 11 skipped), OntologyChangeSetIT (79 passed, 8 skipped), OntologyConceptBindingCleanupIT (2 passed), OntologyConceptBindingsIT (171 passed, 10 skipped), OntologyConceptQueryIT (44 passed), OntologyConceptResourceIT (7 passed, 1 skipped), OntologyEditLockResourceIT (2 passed), OntologyGovernanceIT (13 passed), OntologyImpactIT (16 passed), OntologyPackResourceIT (14 passed), OntologyPatternIT (35 passed, 2 skipped), OntologyPropertyResourceIT (198 passed, 30 skipped), OntologyResourceIT (24 passed, 2 skipped), PipelineResourceIT (196 passed, 18 skipped), PipelineServiceResourceIT (25 passed, 5 skipped), PipelineStatusAuthorizationIT (1 passed), RdfScaleResourcesTest (2 passed), SavedSparqlQueryResourceIT (3 passed), SeedDataPresenceIT (5 passed), TableResourceIT (153 passed, 6 skipped), UserResourceIT (678 passed, 66 skipped)

integration · mysql-elasticsearch · rdf: 33 classes

AgentSparqlResourceIT (22 passed), LodResourceIT (9 passed), RdfBatchFieldsIT (3 passed), RdfBlueGreenRebuildIT (36 passed), RdfEntityDiffWriteIT (2 passed), RdfFusekiAuthorizationIT (19 passed), RdfGlossaryGraphIT (11 passed), RdfGovernanceRulesIT (18 passed), RdfGraphExploreIT (8 passed), RdfIndexAppScaleIT (0 passed, 1 skipped), RdfIndexRunRecoveryIT (4 passed), RdfInferenceMaterializationIT (16 passed), RdfInferenceMultiServerIT (4 passed), RdfLiveProjectionIT (3 passed), RdfLiveWriteRecoveryIT (36 passed), RdfMaintenanceRecoveryIT (10 passed), RdfMcpKnowledgeGraphIT (21 passed), RdfOntologyActivationIT (2 passed), RdfPolicyRevocationIT (5 passed), RdfReindexFailuresIT (13 passed), RdfReindexInsertOnlyIT (1 passed), RdfReindexRunLockIT (5 passed), RdfRelationExclusionsIT (6 passed), RdfResourceIT (15 passed), RdfRoundTripFidelityIT (5 passed), RdfSemanticSearchIT (10 passed), RdfSoftDeleteIT (5 passed), RdfSoftDeleteReindexIT (1 passed), RdfSourceRevisionIT (3 passed), RdfSqlResourceIT (7 passed), RdfStorageMaintenanceIT (14 passed), RdfStorageReadinessIT (2 passed), RdfTagsTierCertificationIT (10 passed)

Why these tests
  • area rdf ← openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfBlueGreenRebuildIT.java, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfEntityDiffWriteIT.java, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfLiveWriteRecoveryIT.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/AssertedGraphTrackingRdfStorage.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfLiveWriteStore.java (+17 more)
  • called from entity Entity ← openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfUpdater.java
  • called from entity Pipeline ← openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfRepository.java
  • called from entity Rdf ← openmetadata-service/src/main/java/org/openmetadata/service/rdf/AssertedGraphTrackingRdfStorage.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfOwnedResources.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfRepository.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/InferenceInvalidatingRdfStorage.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/JenaFusekiStorage.java (+5 more)
  • changed test ← openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfBlueGreenRebuildIT.java, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfEntityDiffWriteIT.java, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfLiveWriteRecoveryIT.java, openmetadata-service/src/test/java/org/openmetadata/service/rdf/AssertedGraphTrackingRdfStorageTest.java, openmetadata-service/src/test/java/org/openmetadata/service/rdf/RdfLiveWriteTest.java (+6 more)
  • entity Rdf ← openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfRepository.java
  • smoke ← code other than a test class changed
Impacted, not run locally (4)
  • RdfCatalogScaleIT → only with -DrdfCatalogScale=true, which no CI lane sets
  • OntologyScaleIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • EntityLoaderSmokeUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • PipelineOwnerIndexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
Commands
mvn -B package -pl openmetadata-mcp,openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=AgentSparqlServiceTest,AssertedGraphTrackingRdfStorageTest,CentralityComputationTest,CommunityComputationTest,CompactionBlockedWriteTest,EntityNeighborhoodToolTest,EntityWriteCircuitBreakerTest,FindByTagToolTest,InferenceInvalidatingRdfStorageTest,JenaFusekiDatasetAdminTest,JenaFusekiStorageTest,JenaFusekiStreamingAppendTest,LineagePathFinderTest,MetricGroupRepositoryTest,OntologyActiveGraphStorageTest,OntologyDescribeToolTest,RdfAutoTuneTest,RdfBatchProcessorTest,RdfBlueGreenDatasetTest,RdfBulkSinkTest,RdfCustomPropertyProjectionTest,RdfEntityDeleteLineageTest,RdfEntityWritePlannerTest,RdfExtensionProjectionTest,RdfGlossaryRelationCleanupQueryTest,RdfGlossaryTermGraphFilterTest,RdfGlossaryTermRelationTest,RdfGraphHelpersTest,RdfGraphServiceTest,RdfIndexAppTest,RdfIndexingFieldsTest,RdfInferenceAppTest,RdfInferenceGuardrailTest,RdfInsightsServiceTest,RdfJenaBootstrapTest,RdfLineageBatchingTest,RdfLineageOntologyTest,RdfLiveWriteTest,RdfLiveWriterTest,RdfMutationUpdateShapeTest,RdfOwnedResourcesTest,RdfParserHelpersTest,RdfPredicatePartitionTest,RdfProjectionHealthTest,RdfPropertyMapperTest,RdfReindexLabelLookupTest,RdfRelationPredicateValidationTest,RdfRepositoryBulkChunkingTest,RdfRepositoryProjectionHealthTest,RdfResourceTest,RdfRuleInputProjectionTest,RdfSparqlServiceTest,RdfStorageIdempotencyTest,RdfStorageMaintenanceExceptionMapperTest,RdfStorageMaintenanceServiceTest,RdfToolGatingTest,RdfUpdaterTest,RdfValidationServiceTest,SerializedRdfPayloadTest,ShaclValidateToolTest,SparqlQueryToolAgentProfileTest,SparqlQueryToolTest,StorageFactsTest,StorageGuardRefusalTest,TestCaseRepositoryTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel '-Dit.test=<82 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=global-state -Dit.test=EntityShapeIT,GlossaryOntologyExportIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=rdf '-Dit.test=<33 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pcache-tests -DintegrationTests.lane=parallel -Dit.test=EntityCacheWriteOrderIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false

Both PR reviews found that a write already queued in Fuseki (an abandoned
request, a timed-out reindex chunk, a dead server's request) can commit
between a difference's read and its update, leaving a mixed graph a full
replacement would have avoided; the queue's lastError marker missed crashes,
older servers and later rows. TDB2 admits writers in arrival order, so after
the update returns every write queued ahead of it has committed: the write
now reads the projection back and replaces it whole when it differs
(outcome "corrected"). That covers every writer, so the queue redelivery
machinery (failedBefore, requestPending, replacingEntityWrites) is removed
and those files return to main.

- Journal replay passes REPLACE explicitly, as before this change.
- The IT and ADR no longer claim an unchanged write reaches Fuseki once.
- ADR: rewritten limits, Turtle/RDF-XML list export shape.
…mitted

A difference can commit before its read-back or reply fails; the queue's retry then finds the projection stored and reports UNCHANGED, so nothing refreshed inference. InferenceInvalidatingRdfStorage now marks rules dirty when storeEntity throws. Also: RdfEntityWriteStrategy Javadoc matches the read-back, and RdfMutationReplayTest pins journal replay to REPLACE.
@fmcardoso

Copy link
Copy Markdown
Member Author

Local Java test run: PASSED — details

  • Commit: f95b681287bc (base origin/main)
  • The summary is in the PR description.

Every test skipped, so these exercised nothing (check their assumptions — usually the engine): BaseEntityIT$ListEntityHistoryByTimestampPaginationTest (mysql-elasticsearch · parallel), RdfIndexAppScaleIT (mysql-elasticsearch · rdf)

Tests run locally

  • unit · openmetadata-service (34 classes): 34 classes, 323 tests executed (listed below)
  • integration · mysql-elasticsearch · parallel: 59 classes, 1828 tests executed (listed below)
  • integration · mysql-elasticsearch · isolated: GlossaryOntologyExportIT (16 passed)
  • integration · mysql-elasticsearch · rdf: 33 classes, 324 tests executed (listed below)

Per-class counts come from the test reports, which can credit a test to the wrong class when classes run concurrently, and keep only the last run of a nested class that several test classes inherit. The summary's step totals are Maven's own counts.

unit · openmetadata-service (34 classes): 58 classes

AssertedGraphTrackingRdfStorageTest (5 passed), CompactionBlockedWriteTest (2 passed), EntityWriteCircuitBreakerTest (1 passed), InferenceInvalidatingRdfStorageTest (4 passed), JenaFusekiDatasetAdminTest (17 passed), JenaFusekiStorageTest (0 passed), JenaFusekiStorageTest$ConfigurationDefaultTests (2 passed), JenaFusekiStorageTest$DatasetRedirectionTests (6 passed), JenaFusekiStorageTest$EncodePathSegmentTests (3 passed), JenaFusekiStorageTest$EntityUpsertQueryTests (5 passed), JenaFusekiStorageTest$GraphTripleCountQueryTests (2 passed), JenaFusekiStorageTest$MaskUserInfoTests (5 passed), JenaFusekiStorageTest$MetricsParsingTests (2 passed), JenaFusekiStorageTest$ParseDatasetEndpointTests (9 passed), JenaFusekiStorageTest$PayloadGuardTests (5 passed), JenaFusekiStorageTest$RelationshipReconciliationQueryTests (1 passed), JenaFusekiStorageTest$RequestTimeoutClassificationTests (2 passed), JenaFusekiStreamingAppendTest (4 passed), OntologyActiveGraphStorageTest (4 passed), RdfBatchProcessorTest (24 passed), RdfBlueGreenDatasetTest (0 passed), RdfBlueGreenDatasetTest$AlternationTests (3 passed), RdfBlueGreenDatasetTest$RepositoryRoutingTests (5 passed), RdfCustomPropertyProjectionTest (5 passed), RdfEntityDeleteLineageTest (1 passed), RdfEntityWritePlannerTest (12 passed), RdfExtensionProjectionTest (2 passed), RdfGlossaryTermGraphFilterTest (6 passed), RdfGlossaryTermRelationTest (62 passed), RdfIndexingFieldsTest (2 passed), RdfInferenceGuardrailTest (9 passed), RdfJenaBootstrapTest (1 passed), RdfLineageBatchingTest (5 passed), RdfLineageOntologyTest (10 passed), RdfLiveWriteTest (20 passed), RdfMutationReplayTest (1 passed), RdfOwnedResourcesTest (3 passed), RdfPredicatePartitionTest (3 passed), RdfPropertyMapperTest (0 passed), RdfPropertyMapperTest$AddTypedPropertyBlankString (4 passed), RdfPropertyMapperTest$ChangeDescriptionTests (2 passed), RdfPropertyMapperTest$ColumnResourceTests (9 passed), RdfPropertyMapperTest$DedicatedMapperFieldTests (2 passed), RdfPropertyMapperTest$ExtensionTests (1 passed), RdfPropertyMapperTest$GeneralPropertyMappingTests (13 passed), RdfPropertyMapperTest$LifeCycleTests (1 passed), RdfPropertyMapperTest$LineageTests (3 passed), RdfPropertyMapperTest$TestCaseResultTests (1 passed), RdfPropertyMapperTest$TranslatorManagedPredicatesTests (2 passed), RdfPropertyMapperTest$VotesTests (1 passed), RdfReindexLabelLookupTest (1 passed), RdfRepositoryBulkChunkingTest (11 passed), RdfRepositoryProjectionHealthTest (1 passed), RdfRuleInputProjectionTest (6 passed), RdfStorageIdempotencyTest (4 passed), SerializedRdfPayloadTest (3 passed), StorageFactsTest (2 passed), StorageGuardRefusalTest (3 passed)

integration · mysql-elasticsearch · parallel: 60 classes

BaseEntityIT$ListEntityHistoryByTimestampPaginationTest (0 passed, 5 skipped), ConfigResourceIT (12 passed), DatabaseSmokeIT (5 passed), GlossaryRdfImportIT (8 passed, 1 skipped), GlossaryTermResourceIT (181 passed, 23 skipped), IndependentOntologyActivationIT (29 passed, 2 skipped), IndependentOntologyApprovalIT (35 passed, 1 skipped), IndependentOntologyAuthorizationIT (1 passed), IndependentOntologyAxiomIT (8 passed, 3 skipped), IndependentOntologyClassModelIT (2 passed), IndependentOntologyHierarchyIT (31 passed, 3 skipped), IndependentOntologyInverseIT (42 passed, 5 skipped), IndependentOntologyPublicationIT (101 passed, 9 skipped), IndependentOntologyReferenceIT (7 passed), IndependentOntologyReleaseDiffIT (3 passed), IndependentOntologyReleaseExportAssetsIT (8 passed), IndependentOntologyReleaseExportFormatsIT (29 passed, 2 skipped), IndependentOntologyReleaseExportGateIT (18 passed), IndependentOntologyReleaseExportIT (24 passed, 1 skipped), IndependentOntologyReleaseIT (30 passed, 3 skipped), IndependentOntologyReleaseValidationIT (53 passed, 9 skipped), IndependentOntologyResourceIT (33 passed, 4 skipped), IndependentOntologyRetentionIT (91 passed, 11 skipped), IndependentOntologyReviewRecoveryIT (233 passed, 19 skipped), IndependentOntologyReviewRuleIT (22 passed), IndependentOntologyStatusIT (11 passed), IndependentOntologyWorkingDiffIT (10 passed), McpRdfNotEnabledIT (23 passed, 4 skipped), NativeOntologyCsvInverseReimportIT (4 passed), NativeOntologyDataGraphBindingScanIT (3 passed), NativeOntologyDataGraphContextIT (5 passed), NativeOntologyDataGraphEdgeScanIT (4 passed), NativeOntologyDataGraphIT (5 passed), NativeOntologyDataGraphPageIT (6 passed), NativeOntologyImportIntoNewOntologyIT (2 passed), NativeOntologyImportListRulesIT (16 passed, 6 skipped), NativeOntologyImportPreviewIT (2 passed), NativeOntologyLibraryPreviewIT (4 passed), NativeOntologyMemoryIT (15 passed, 1 skipped), NativeOntologyPackInstallStateIT (10 passed, 4 skipped), OntologyAiResourceIT (2 passed), OntologyAxiomResourceIT (5 passed), OntologyBulkIT (1 passed), OntologyChangeSetIT (81 passed, 11 skipped), OntologyConceptBindingCleanupIT (2 passed), OntologyConceptBindingsIT (239 passed, 9 skipped), OntologyConceptQueryIT (1 passed), OntologyConceptResourceIT (31 passed, 3 skipped), OntologyEditLockResourceIT (2 passed), OntologyGovernanceIT (8 passed), OntologyImpactIT (16 passed), OntologyPackResourceIT (11 passed), OntologyPatternIT (19 passed, 4 skipped), OntologyPropertyResourceIT (61 passed, 8 skipped), OntologyResourceIT (16 passed, 1 skipped), RdfScaleResourcesTest (7 passed), SavedSparqlQueryResourceIT (6 passed), SeedDataPresenceIT (4 passed), TableResourceIT (86 passed), UserResourceIT (79 passed, 4 skipped)

integration · mysql-elasticsearch · rdf: 33 classes

AgentSparqlResourceIT (22 passed), LodResourceIT (9 passed), RdfBatchFieldsIT (4 passed), RdfBlueGreenRebuildIT (36 passed), RdfEntityDiffWriteIT (7 passed), RdfFusekiAuthorizationIT (14 passed), RdfGlossaryGraphIT (11 passed), RdfGovernanceRulesIT (10 passed), RdfGraphExploreIT (8 passed), RdfIndexAppScaleIT (0 passed, 1 skipped), RdfIndexRunRecoveryIT (4 passed), RdfInferenceMaterializationIT (16 passed), RdfInferenceMultiServerIT (4 passed), RdfLiveProjectionIT (3 passed), RdfLiveWriteRecoveryIT (34 passed), RdfMaintenanceRecoveryIT (10 passed), RdfMcpKnowledgeGraphIT (21 passed), RdfOntologyActivationIT (2 passed), RdfPolicyRevocationIT (5 passed), RdfReindexFailuresIT (13 passed), RdfReindexInsertOnlyIT (1 passed), RdfReindexRunLockIT (5 passed), RdfRelationExclusionsIT (6 passed), RdfResourceIT (15 passed), RdfRoundTripFidelityIT (5 passed), RdfSemanticSearchIT (10 passed), RdfSoftDeleteIT (3 passed), RdfSoftDeleteReindexIT (1 passed), RdfSourceRevisionIT (3 passed), RdfSqlResourceIT (7 passed), RdfStorageMaintenanceIT (14 passed), RdfStorageReadinessIT (11 passed), RdfTagsTierCertificationIT (10 passed)

Why these tests
  • area rdf ← openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfBlueGreenRebuildIT.java, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfEntityDiffWriteIT.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/AssertedGraphTrackingRdfStorage.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfOwnedResources.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/rebuild/RdfMutation.java (+12 more)
  • called from entity Rdf ← openmetadata-service/src/main/java/org/openmetadata/service/rdf/AssertedGraphTrackingRdfStorage.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfOwnedResources.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/InferenceInvalidatingRdfStorage.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/JenaFusekiStorage.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/RdfStorageInterface.java (+1 more)
  • changed test ← openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfBlueGreenRebuildIT.java, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfEntityDiffWriteIT.java, openmetadata-service/src/test/java/org/openmetadata/service/rdf/AssertedGraphTrackingRdfStorageTest.java, openmetadata-service/src/test/java/org/openmetadata/service/rdf/RdfOwnedResourcesTest.java, openmetadata-service/src/test/java/org/openmetadata/service/rdf/rebuild/RdfMutationReplayTest.java (+3 more)
  • smoke ← code other than a test class changed
Impacted, not run locally (2)
  • RdfCatalogScaleIT → only with -DrdfCatalogScale=true, which no CI lane sets
  • OntologyScaleIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
Commands
mvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=AssertedGraphTrackingRdfStorageTest,CompactionBlockedWriteTest,EntityWriteCircuitBreakerTest,InferenceInvalidatingRdfStorageTest,JenaFusekiDatasetAdminTest,JenaFusekiStorageTest,JenaFusekiStreamingAppendTest,OntologyActiveGraphStorageTest,RdfBatchProcessorTest,RdfBlueGreenDatasetTest,RdfCustomPropertyProjectionTest,RdfEntityDeleteLineageTest,RdfEntityWritePlannerTest,RdfExtensionProjectionTest,RdfGlossaryTermGraphFilterTest,RdfGlossaryTermRelationTest,RdfIndexingFieldsTest,RdfInferenceGuardrailTest,RdfJenaBootstrapTest,RdfLineageBatchingTest,RdfLineageOntologyTest,RdfLiveWriteTest,RdfMutationReplayTest,RdfOwnedResourcesTest,RdfPredicatePartitionTest,RdfPropertyMapperTest,RdfReindexLabelLookupTest,RdfRepositoryBulkChunkingTest,RdfRepositoryProjectionHealthTest,RdfRuleInputProjectionTest,RdfStorageIdempotencyTest,SerializedRdfPayloadTest,StorageFactsTest,StorageGuardRefusalTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel '-Dit.test=<59 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=global-state -Dit.test=GlossaryOntologyExportIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=rdf '-Dit.test=<33 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@fmcardoso
fmcardoso marked this pull request as ready for review November 4, 2026 16:03
@fmcardoso
fmcardoso requested a review from a team as a code owner November 4, 2026 16:03
@fmcardoso
fmcardoso requested a review from IceS2 November 4, 2026 16:03
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@fmcardoso
fmcardoso enabled auto-merge (squash) November 5, 2026 07:33
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot

gitar-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 closed / 2 findings

🔴 High risk · Differential RDF entity writes and list-cell ownership change stored-graph maintenance; a missed difference or race could leave entity metadata stale or mixed.

Live RDF entity writes now send only the triples that changed (or nothing when unchanged), cutting Fuseki disk growth from repeated full replacements, with a read-back guard against interfering writes. The one open-to-discussion item, marking all inference stale on a failed entity write, is closed without a fix as a deliberate conservative choice. The existence-check chunk size of 1,000 was resolved, and no open findings remain.

✅ 2 closed
✅ Quality: Existence-check chunk size of 1000 is a judgment call with no record

📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/RdfEntityWritePlanner.java:36-37 📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/RdfEntityWritePlanner.java:83-91 📄 docs/decisions/2026-11-03-live-rdf-entity-writes-send-only-the-changed-triples.md:20-34
RdfEntityWritePlanner.EXISTENCE_CHECK_CHUNK = 1000 caps how many triples go into the VALUES block of one existence read. That cap decides how many CONSTRUCT round trips a wide table's write makes, and how large each query is that Fuseki has to parse under its query timeout. The ADR added in this PR records the other thresholds: the difference-larger-than-projection fallback, the blank-node fallback, and the list-cell naming. It says nothing about this batch size, and the only justification is the javadoc's "reads are cheap, a huge query is not". Following the repository's decision-record rule, add one line to docs/decisions/2026-11-03-live-rdf-entity-writes-send-only-the-changed-triples.md, for example: "A write checks which of its projection's out-of-scope triples Fuseki already holds in reads of at most 1,000 triples each, which bounds the query size Fuseki parses within its query timeout." Also say what to watch for before changing the number.

Closed: Edge Case: Entity writes that never reached Fuseki still mark all inference stale

📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/InferenceInvalidatingRdfStorage.java:56-62 📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/JenaFusekiStorage.java:1301 📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/JenaFusekiStorage.java:1314-1317 📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/JenaFusekiStorage.java:745-749
The new catch (RuntimeException) calls markAllDirty() on every failure, including ones where nothing was sent. For example, throwIfCircuitOpen throws RdfStorageCircuitOpenException before any read, a maintenance hold-back can stop a write before its update, and a scope read can fail before send. Each of these runs UPDATE rdf_inference_rule SET dirty = TRUE, dirtyVersion = dirtyVersion + 1, so during a Fuseki outage every rejected write does a DB write and forces rematerialization later. If that DB call itself fails, its exception replaces the typed storage exception that callers use to decide how to retry. Only mark dirty when the outcome is uncertain: skip RdfStorageCircuitOpenException and held-back maintenance exceptions, or have the planner report whether an update was sent. If you keep the catch, wrap markAllDirty() so the original failure is the one rethrown.

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

@fmcardoso fmcardoso added the safe to test Add this label to run secure Github workflows on PRs label Nov 5, 2026
@fmcardoso
fmcardoso merged commit d811bd7 into main Nov 5, 2026
93 of 98 checks passed
@fmcardoso
fmcardoso deleted the fmcardoso/reduce-fuseki-disk-growth-by-writing-only-change branch November 5, 2026 08:28
fmcardoso added a commit that referenced this pull request Nov 6, 2026
…ackport 2.0 #37069) (#37177)

* Fixes #36671: Live RDF entity writes send only the changed triples (backport 2.0 #37069)

Backport of #37069, adapted to 2.0:

- 2.0 has no InferenceInvalidatingRdfStorage or AssertedGraphTrackingRdfStorage (main-only,
  from #28042 and #35201), so their changes and tests are left out.
- 2.0 does not project table columns as resources, so RdfPropertyMapper keeps only the named
  list cells, and the two tests that relied on column triples use extension properties or
  the 2.0 counts instead.
- The new tests use 2.0's JsonLdTranslator constructor and JenaFusekiStorage.isTimeoutError,
  now package-private for the circuit-breaker test.
- The ADR and the production setup guide drop the inference statements that do not apply.

(cherry picked from commit d811bd7)

* Run RdfEntityDiffWriteIT on 2.0: add FusekiTestImage, wide table in custom properties

2.0 has no FusekiTestImage and does not project a table's columns, so the
wide-table test changes a table tag on a table with 200 custom properties.

* Benchmark 2.0 with tables wide in custom properties

2.0 does not project a table's columns, so the disk-growth harness builds tables
with 300 custom properties and changes one per write instead of moving a column
tag. The decision record gains the 2.0 measurement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.1 safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce Fuseki disk growth by writing only changed RDF triples

2 participants