Skip to content

Refuse writes before the data volume fills, and report storage use - #12

Merged
manerow merged 2 commits into
release/6.2.0from
fix/36437-storage-stats-guard
Nov 1, 2026
Merged

manerow merged 2 commits into
release/6.2.0from
fix/36437-storage-stats-guard

Conversation

@manerow

@manerow manerow commented Oct 28, 2026 •

Copy link
Copy Markdown

Stops a full data volume from taking Fuseki down, and reports how the TDB2 datasets use the volume so OpenMetadata can compact before it fills. Part of open-metadata/OpenMetadata#36437.

TDB2 never reuses disk by itself: every write transaction copies the index pages it touches, and the old pages stay until the dataset is compacted. TDB2 also memory-maps its files, so a write on a full volume does not fail cleanly: the JVM gets SIGBUS and exits, and exits again on every restart until someone frees space by hand. In production the crash also wrote heap-sized core dumps to the node's disk, which got the pod evicted.

Change

In the extension (only when OPENMETADATA_EXTENSION_ENABLED=true):

  • Write guard. While the data volume has less usable space than OPENMETADATA_STORAGE_MIN_FREE (default 10%; a percentage, or a size such as 20g), SPARQL updates and Graph Store uploads and deletes get HTTP 507 Insufficient Storage, the standard status for this (RFC 4918). The guard answers before anything reaches TDB2, so nothing is applied. Reads and compaction are never refused, so the volume can always be compacted back. An invalid reserve stops Fuseki at startup.
  • Storage report. GET /$/openmetadata/storage (admin only, like every path but /$/ping) returns totalBytes, usableBytes, reserveBytes and lowOnSpace.
  • The update operation is re-registered with the SPARQL update content type, so updates POSTed to the dataset URL keep working (without it Fuseki answers them with 415).

In the entrypoint (always): the JVM starts with -XX:-CreateCoredumpOnCrash, so a crash no longer writes a heap-sized core dump. The hs_err report is still written.

The README gets both settings and a "Disk space" section. OpenMetadata's side (reading the report, compacting early, treating the 507 as a retry rather than a failed write) is PR #36472 in open-metadata/OpenMetadata, which also adds the same code to OpenMetadata's own docker/rdf-store image.

Verification

  • Extension: 171 unit tests and 11 integration tests pass (mvn verify), including new ones for the reserve parsing, the refusal and the report.
  • docker build --check: no warnings.
  • test/smoke-test.sh on the built image passes, with a new "Disk space" section: with a reserve larger than the volume, updates (to /update and to the dataset URL) get 507, uploads get 507, nothing refused is applied, and queries and compaction still work. It also covers the admin-only report, the core dump flag and an invalid reserve.
  • End to end with OpenMetadata, on the first revision of this PR (a 503 refusal), on a small volume under a 15,000-write backlog: the guard refused 39 writes, OpenMetadata compacted early 3 times (about 20 seconds each) and retried them, and Fuseki never crashed.

@manerow
manerow merged commit 68fb3ac into release/6.2.0 Nov 1, 2026
3 checks passed
harshach added a commit that referenced this pull request Nov 10, 2026
Brings in the RULES step (#5), protocol gaps (#4), the Guava bump (#14) and
the image fixes (#9-#12). Conflicts kept both sides: the direct-buffer cap
beside the core-dump flag in the entrypoint, the measured CLASSIFY envelope
beside the RULES limits in the README, and both import sets in Limits.
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