Repository navigation
Fixes #36437: Refuse RDF writes before Fuseki's volume fills and compact early when it runs low - #36472
Conversation
…ring maintenance
…act early when it runs low
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
✅ Generated Sources Auto-UpdatedThe generated TypeScript types ( |
…lure, metrics in OntologyMetrics
…torage-guard # Conflicts: # openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/JenaFusekiStorage.java
…heck every 15 minutes
…o fix/36437-rdf-storage-guard
…e' into fix/36437-rdf-storage-maintenance
…torage-guard # Conflicts: # openmetadata-ui/src/main/resources/ui/src/generated/api/configuration/rdfConfiguration.ts
… pause, compactions are tracked to the end, pipeline runs go through the queue
…, and wait for the next scheduled compaction after a futile urgent one
…torage-guard # Conflicts: # openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/JenaFusekiStorage.java # openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/RdfStorageMaintenanceException.java # openmetadata-service/src/test/java/org/openmetadata/service/rdf/maintenance/RdfStorageMaintenanceServiceTest.java
…ing generation's size would refuse the compactions a full volume needs
… crashing it again
…o fix/36437-rdf-storage-guard
Keep the serving pause while Fuseki tasks outlive their budget or return unreadable responses. Transfer the queue consumer fence to upgraded servers before emitting pipeline execution payloads. Refs #36437
Start the compaction health clock before contacting Fuseki and keep scheduled health reporting independent of the compaction worker. Keep consumer migration statements in the RDF schema section.
…e' into fix/36437-rdf-storage-guard # Conflicts: # docker/rdf-store/Dockerfile # docker/rdf-store/entrypoint.sh # docker/rdf-store/src/main/java/org/openmetadata/fuseki/BoundedGraphStore.java # docker/rdf-store/src/main/java/org/openmetadata/fuseki/OpenMetadataFusekiModule.java
…-guard # Conflicts: # conf/openmetadata.yaml # docs/rdf-production-setup.md # openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/RdfIndexApp.java # openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfRepository.java # openmetadata-service/src/main/java/org/openmetadata/service/rdf/maintenance/RdfStorageMaintenanceService.java # openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/ForwardingRdfStorage.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 # openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/RdfStorageMaintenanceException.java # openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/rdf/RdfIndexAppTest.java # openmetadata-service/src/test/java/org/openmetadata/service/rdf/maintenance/RdfStorageMaintenanceServiceTest.java # openmetadata-spec/src/main/resources/json/schema/api/configuration/rdfConfiguration.json # openmetadata-ui/src/main/resources/ui/src/generated/api/configuration/rdfConfiguration.ts
…reader for the storage guard
Code Review ✅ Approved 2 closed / 2 findings🔴 High risk · Changing RDF write deferral, compaction, and reindex-clear behavior affects stored-data integrity; full storage could stall queued updates or prevent recovery. Adds a free-space write guard to the Fuseki RDF store that refuses writes with HTTP 507 below a reserve, plus an admin storage report and urgent compaction when space runs low. Resolved this session: the urgent slot now holds a full interval instead of waiting for the next scheduled compaction, and the bulk reconcile path no longer logs guard refusals at ERROR or wraps them. No open issues found. ✅ 2 closed✅ Bug: Urgent slot held a full interval, not until the next scheduled compaction
✅ Quality: Bulk reconcile path still logs guard refusals at ERROR and wraps them
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 |
|
|
…act early when it runs low (backport 2.0 #36472) (#36661) * Fixes #36437: Compact the RDF store on a schedule and pause writes during maintenance * Fixes #36437: Refuse RDF writes before Fuseki's volume fills and compact early when it runs low * Simplify RDF storage maintenance: one compaction API, plain clear failure, metrics in OntologyMetrics * Simplify the RDF storage guard: answer 507, report the volume only, check every 15 minutes * Refuse a compaction the volume cannot hold, accept a 507 at readiness, and wait for the next scheduled compaction after a futile urgent one * Keep RDF writes safe during storage maintenance: writers wait for the pause, compactions are tracked to the end, pipeline runs go through the queue * Wait for the next interval after a compaction Fuseki lost, instead of crashing it again * Never refuse a compaction: the copy holds only live data, so the serving generation's size would refuse the compactions a full volume needs * Check that an urgent compaction Fuseki lost waits for the next scheduled one * Name only the reindex lock for urgent compactions: 2.0 has no inference runs * Wait for a maintenance pause up to the RDF request timeout * Make RDF write delivery explicit: the queue, direct writers and the pause holder each write through their own handle * Start RDF storage maintenance only once every live server holds its writes back, using a server registry * Empty the dataset a blue/green promotion retires, so only the serving dataset keeps a full copy * Run the storage maintenance IT on the production image with the OpenMetadata extension on, as production does * Pin the storage report contract the Fuseki images serve, and an image without it * Wait for the next interval after any compaction Fuseki started and did not finish, not only one it lost * Drop the server registry: a compaction copies only live data, so servers that do not pause just wait it out * Use one reindex lock factory for runs and storage maintenance * Report a compaction overdue for two intervals at ERROR and as a degraded RDF projection, whatever stopped it * Let a reindex recover a full volume: a clear the disk guard refuses compacts to make room and runs once more * Keep core dumps off in the Fuseki image when a deployment sets its own JVM_ARGS * Say what an urgent compaction that cannot free space does: urgent ones stop for an interval, the scheduled one still runs * Say that the overdue rule counts maintenance compactions * fix(ui): restore 2.0 schema generation Resolve the pinned quicktype CLI without root node_modules so the lightweight PR workflow can regenerate the release schemas. Regenerate the committed TypeScript models, including RDF storage maintenance. * chore(rdf): generate 2.0 disk guard types * fix(rdf): retain maintenance delivery fences Keep the serving pause while Fuseki tasks outlive their budget or return unreadable responses. Transfer the queue consumer fence to upgraded servers before emitting pipeline execution payloads. Refs #36437 * test(rdf): count only SPARQL updates in recovery * fix(rdf): monitor health during stalled compaction Start the compaction health clock before contacting Fuseki and keep scheduled health reporting independent of the compaction worker. Keep consumer migration statements in the RDF schema section. * test(rdf): await maintenance health report * Reuse Guava's causal chain, Jena's 507 constant and the lenient JSON reader for the storage guard * Pass low-disk refusals through the bulk reconcile path and do not bisect them --------- Co-authored-by: Pere Miquel Brull <[email protected]>



Describe your changes:
Fixes #36437
Problem
OpenMetadata compacts the RDF store once a day, but a burst of ingestion can fill Fuseki's volume within hours. TDB2 memory-maps its files, so a write on a full volume kills the JVM (SIGBUS) on every restart. In production, its heap-sized core dumps also filled the node's disk and got the pod evicted.
What this PR changes
In the Fuseki image, which main now builds from the open-metadata/jena fork, so this part is jena PR #12:
OPENMETADATA_STORAGE_MIN_FREE(10% by default), every write gets HTTP 507 Insufficient Storage and nothing is applied. Reads and compaction keep working.GET /$/openmetadata/storage(admin only) returns the volume's size, free space, reserve and whether writes are refused.JVM_ARGS.In the server:
RDF_URGENT_COMPACTION_FREE_PERCENT(50) or the guard refusing writes, it compacts without waiting for the daily slot. 50% leaves room for the copy of the live data. If compacting cannot get back above the threshold, the server logs at ERROR that the volume needs expanding, and urgent compactions stop for one interval while the daily one still runs.Decision record:
ADR:2026-10-28-the-fuseki-image-refuses-writes-below-a-free-space-reserve-and-reports-its-volume.What operators will notice
A volume that fills faster than the daily compaction no longer takes Fuseki down: writes pause while a compaction frees space, then resume. Expand the volume only when the server log says so. Roll out the new Fuseki image with or after the OpenMetadata release that has this PR: an older server dead-letters the writes the guard refuses.
How it was tested
openmetadata/fuseki:6.2.0-c75b095, which has no guard yet, so they cover the schedule-only path. Before the image moved to the fork, the full RDF lane also passed on an image with the guard.Not in this PR
openmetadata/fusekitag in this repository. That follows jena PR Logos for all services shows MySQL #12, which merges after the OpenMetadata release that has this PR: merging it also moves the6.2.0tag that production pulls.Type of change:
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.docs/decisions/2026-10-28-the-fuseki-image-refuses-writes-below-a-free-space-reserve-and-reports-its-volume.md.Collate configuration companion: https://github.com/open-metadata/openmetadata-collate/pull/8029. Stack refresh
eafc7bc77c5: backend packaged successfully;StorageGuardRefusalTest,StorageFactsTest, andRdfStorageMaintenanceServiceTestpassed (26 tests, 0 failures). Merge #36471 first, then retarget this PR tomainand rerun its Collate compatibility workflow.Refreshed maintenance base
Includes the recovery fixes from #36471: the shared serving pause survives a compaction budget overrun and malformed/unavailable task responses; the versioned consumer fence protects
pipelineExecutionduring rolling upgrades; health reporting continues while compaction waits. Merge conflicts preserved both the disk-reporting/507 guard and the pause-preserving compaction API.Validation at
f283cc995f5: 113 focused unit tests plus 10 recovery integration cases passed, using real MySQL and PostgreSQL with an HTTP Fuseki boundary. Coverage includes disk facts, HTTP 507 retry classification, urgent compaction, pause retention, legacy-consumer exclusion and migration handoff, and compaction-health reporting. Spotless and independent review passed; no unanswered important findings.Merge #36471 first, then retarget this PR to its release branch and rerun the Collate build. The current feature-branch base does not exist in the Collate repository. Deploy upgraded servers before publishing/rolling out the guarded Fuseki image.
The broader affected-test run executed 620 service tests and stopped at the same 5 pre-existing
RdfBatchProcessorTestfailures caused by static registry interference withRdfResourceTest. It did not reach MCP or the wider IT matrix. The focused unit suite and 10 real-database recovery ITs above passed separately. The planner'sForwardingRdfStoragereference warning concerns additive pass-through delegation; combined storage behavior is exercised by the recovery ITs.