Repository navigation
Fixes #32057: single-writer RDF reindex pipeline and Jena 6.2.0 upgrade - #32262
Conversation
…n rebuilds A production RDF reindex ran 164 hours for ~168k records at 0.2 rec/s with 11,942 permanently-failed records. Root cause was an amplification loop rather than raw slowness: batches were sized by entity count, so wide tables produced multi-MB SPARQL bodies that exceeded the request timeout, and because a client timeout does not cancel the server-side update, every same-size retry piled more work onto an already-saturated Fuseki before degrading into a 25-way per-entity fallback and a circuit-breaker cooldown. Bound the write path: - Chunk by estimated serialized bytes with a hard post-serialization guard that halves oversized chunks, instead of a fixed entity count. - Send insert-only rebuild chunks via the Graph Store Protocol so Fuseki parses N-Triples with the streaming parser rather than the SPARQL grammar, and budget them separately (16MB / 1000 entities) since they carry no DELETE statements. Fewer, larger transactions is the lever that matters on single-writer TDB2. - Stop retrying oversized timeouts at the same size; signal callers to split. - Replace the per-entity fallback with a bisect plus a wall-clock budget, so a poison row costs ~10 write calls instead of 25 timeouts and a pathological batch costs minutes rather than hours. - Cap failure-isolation retries (maxRetries, default 3, editable on the app) and honour the circuit breaker on the per-source relationship path. Make the run observable and recoverable: - Record reader/sink timings through partition -> entity stats -> StepStats; the run that burned a week reported "<1 ms" averages because nothing measured the storage round trip. - Add Micrometer timers, payload-size summaries and slow-request warnings. - Persist failures to rdf_index_failures, cleared at the start of each run, and degrade relationship writes per source instead of failing a whole batch. Cut translation overhead: - Hoist tag/glossary FQN->UUID caches to process scope (they were allocated per entity and could never hit), reuse one property mapper, and pre-flatten JSON-LD contexts once per context instead of per entity. - Route both the write and export paths through one context registry, so ~30 entity types stop degrading to opaque JSON string literals. Add blue/green rebuilds behind RDF_BLUE_GREEN_REBUILD_ENABLED (default off): a rebuild populates an idle alternate dataset and flips a pointer on success, so the served graph is no longer cleared for the duration of a run. Two fixed names alternate because Fuseki does not guarantee that deleting a dataset reclaims disk; the previous dataset is retained as a rollback window. Also fixes endpoint parsing that accepted relative URIs and yielded a "null://null" server base, which would have corrupted admin URLs. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…scheduling Rebuilds the RDF indexing path around the constraint that TDB2 has one writer, mirroring the fix already proven on SearchIndexApp. Partition workers now only read and translate; every write for a dataset funnels through RdfBulkSink, which keeps exactly one HTTP request in flight and acks in FIFO order, so cursors advance on ack and a client timeout measures real server work instead of queue position. Appends stream per-entity models straight into the request body as RDF Thrift (StreamRDF), keeping indexer memory flat regardless of chunk size, with optional gzip -- never deflate, which Fuseki mis-maps to a compressing stream. Fuseki moves to 6.2.0 on temurin-21, launched with --config rather than --loc so arq:updateTimeout exists at all: a client deadline does not stop server-side work, so without it a runaway UPDATE holds the single writer lock indefinitely. FUSEKI_BASE moves onto the data volume, fixing blue/green datasets that were being created inside the image layer and lost on container replacement. Scheduling gets two guards. Heavy apps use the Quartz DoNothing misfire policy, so a pod restarting after a missed weekend trigger no longer launches a surprise full reindex at deploy time. A cron-triggered RDF run defers while a search reindex is live -- two concurrent full entity-table scans thrash the database -- and ends STOPPED with an explanation if it never gets a window. On-demand runs bypass with a warning, because operator intent wins. RDF reindex failures are finally reachable: GET /v1/rdf/reindex/failures (admin only) plus the UI drawer switching fetchers by app name. It previously always called the search endpoint, which is why failed RDF records had no visible detail. Blue/green promotion additionally refuses to flip the pointer when the run lost more than minSuccessRatio of records, leaving the old dataset serving. Migrations land in 2.0.1 so this can ship ahead of 2.1.0; the MySQL column adds are guarded via information_schema because moving to an earlier version means a database that already applied them must not fail. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
There was a problem hiding this comment.
Pull request overview
This PR modernizes OpenMetadata’s RDF indexing stack to respect Fuseki/TDB2’s single-writer constraint, improve throughput and reliability via streaming append writes and payload budgeting, and upgrades the shipped Fuseki/Jena baseline to 6.2.0. It also adds operational controls (misfire handling + cross-app admission guard) and exposes RDF reindex failures via a dedicated API that the UI can display.
Changes:
- Reworked RDF reindexing into a single-writer pipeline (streamed RDF Thrift appends, byte-budgeted chunking, payload guards, better failure visibility).
- Upgraded Jena/Fuseki to 6.2.0 and refreshed Docker/K8s/compose artifacts to support non-root, config-driven Fuseki startup (incl. update timeout).
- Added scheduling safeguards (Quartz misfire policy + RDF/Search reindex admission guard) and a new
/v1/rdf/reindex/failuresendpoint + UI wiring.
Reviewed changes
Copilot reviewed 70 out of 71 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/rdf-reindex-benchmark.sh | New end-to-end RDF rebuild benchmark helper script. |
| scripts/ingest_100k_tables.py | Seeder enhancements to generate “wide table” shapes for benchmarks. |
| pom.xml | Bumps Jena client dependency version to 6.2.0. |
| openmetadata-ui/src/main/resources/ui/src/rest/rdfAPI.ts | Adds typed client for RDF reindex failures endpoint. |
| openmetadata-ui/src/main/resources/ui/src/constants/Applications.constant.ts | Adds RDF app name constant for routing. |
| openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppLogsViewer/ReindexFailures.test.tsx | New Jest tests covering endpoint selection logic. |
| openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppLogsViewer/ReindexFailures.interface.ts | Adds appName prop and common failure-record shape. |
| openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppLogsViewer/ReindexFailures.component.tsx | Routes failures drawer to RDF vs Search endpoints based on app name. |
| openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppLogsViewer/AppLogsViewer.component.tsx | Passes app name into failures drawer. |
| openmetadata-spec/src/main/resources/json/schema/api/configuration/rdfConfiguration.json | Adds RDF payload budgets, streaming/gzip toggles, blue/green flag. |
| openmetadata-service/src/test/java/org/openmetadata/service/rdf/translator/RdfContextRegistryTest.java | New tests for JSON-LD context routing consistency. |
| openmetadata-service/src/test/java/org/openmetadata/service/rdf/storage/JenaFusekiStreamingAppendTest.java | New byte-level test for streamed RDF Thrift append (gzip/no-gzip). |
| openmetadata-service/src/test/java/org/openmetadata/service/rdf/storage/JenaFusekiStorageTest.java | Adds tests for payload guard, retry behavior, dataset redirection, metrics parsing. |
| openmetadata-service/src/test/java/org/openmetadata/service/rdf/RdfRepositoryBulkChunkingTest.java | Tests byte-budget chunk splitting vs append budgets/count caps. |
| openmetadata-service/src/test/java/org/openmetadata/service/rdf/RdfLineageBatchingTest.java | Updates lineage delete builder to avoid full-graph scans; adds guard test. |
| openmetadata-service/src/test/java/org/openmetadata/service/rdf/RdfBlueGreenDatasetTest.java | New unit tests for blue/green dataset alternation/routing. |
| openmetadata-service/src/test/java/org/openmetadata/service/apps/scheduler/AppSchedulerMisfireTest.java | New test verifying misfire policy by app type. |
| openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/rdf/sink/RdfBulkSinkTest.java | New tests for single-writer sink ordering/backpressure/close semantics. |
| openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/rdf/RdfReindexAdmissionGuardTest.java | New tests for RDF/Search reindex contention detection + deferral. |
| openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/rdf/RdfIndexAppTest.java | Updates tests for admission guard + promotion ratio behaviors and recreate compaction flow. |
| openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/rdf/RdfAutoTuneTest.java | New tests for heap-based append budget auto-tuning. |
| openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/rdf/distributed/RdfPartitionWorkerTest.java | Adapts partition worker tests to use the new bulk sink. |
| openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/rdf/distributed/RdfPartitionCalculatorTest.java | New tests for partition caps and widening behavior. |
| openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/rdf/distributed/RdfOrphanJobMonitorTest.java | New tests for orphan recovery scheduling + failure containment. |
| openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/rdf/distributed/DistributedRdfIndexCoordinatorTest.java | Updates stats aggregation tests for new timing fields. |
| openmetadata-service/src/main/resources/json/data/appMarketPlaceDefinition/RdfIndexApp.json | Updates RDF app defaults (retries, min success ratio). |
| openmetadata-service/src/main/resources/json/data/app/RdfIndexApp.json | Updates installed RDF app defaults (retries, min success ratio). |
| openmetadata-service/src/main/java/org/openmetadata/service/resources/rdf/RdfReindexResource.java | New admin-gated RDF reindex failures endpoint. |
| openmetadata-service/src/main/java/org/openmetadata/service/rdf/translator/RdfPropertyMapper.java | Adds bounded caches, context flattening cache, and JSON-literal size cap. |
| openmetadata-service/src/main/java/org/openmetadata/service/rdf/translator/RdfContextRegistry.java | New single source of truth for entity-type → context routing. |
| openmetadata-service/src/main/java/org/openmetadata/service/rdf/translator/JsonLdTranslator.java | Reuses a single property mapper and centralizes context selection. |
| openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/RdfStorageInterface.java | Adds payload budgeting constants/helpers + dataset-management interface + heap metrics hook. |
| openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/RdfStorageFactory.java | Allows storage creation pinned to a specific dataset (blue/green). |
| openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/RdfPayloadTooLargeException.java | New exception to stop counterproductive same-size retries on timeouts. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/scheduler/AppScheduler.java | Adds triggerType key constant + misfire policy for heavy reindex apps. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/sink/RdfBulkSink.java | New single-writer buffering sink for RDF indexing. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/RdfReindexAdmissionGuard.java | New admission guard to avoid RDF/Search full reindex collisions. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/RdfIndexingRunContext.java | Expands per-run context with identity + retry settings. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/RdfAutoTune.java | New heap-aware append budget auto-tuning helper. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/distributed/RdfPartitionCalculator.java | Adds per-entity/total partition caps and widening behavior. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/distributed/RdfOrphanJobMonitor.java | New scheduled orphan job recovery monitor. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/distributed/RdfIndexPartition.java | Adds per-partition timing fields. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/distributed/RdfIndexJob.java | Adds aggregated timing fields to job stats. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/distributed/RdfDistributedJobStatsAggregator.java | Aggregates reader/process/sink timings into Stats/StepStats. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/distributed/RdfDistributedJobParticipant.java | Starts/stops orphan recovery monitor with participant lifecycle. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/distributed/DistributedRdfIndexExecutor.java | Uses per-run bulk sink; routes to build dataset for blue/green recreate runs. |
| openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/rdf/distributed/DistributedRdfIndexCoordinator.java | Persists/loads new timing stats fields. |
| openmetadata-service/pom.xml | Keeps titanium-json-ld pin rationale aligned with Jena 6.2.0. |
| openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfReindexFailuresIT.java | New IT contract tests for RDF failures endpoint + authz. |
| openmetadata-integration-tests/src/test/java/org/openmetadata/it/bootstrap/TestSuiteBootstrap.java | Allows running ITs against shipped Fuseki image; improves tmpfs + env compat. |
| docs/generated/api-reference.md | Updates generated endpoint count and lists new RDF failures endpoint. |
| docker/rdf-store/shiro.ini.template | Allows anonymous scrape of /$/metrics (Prometheus). |
| docker/rdf-store/kubernetes/fuseki-deployment.yaml | Updates production guidance (non-root, fsGroup, JVM args, sizing, resources). |
| docker/rdf-store/entrypoint.sh | Moves FUSEKI_BASE to volume, renders shiro.ini there, adds writability guard. |
| docker/rdf-store/Dockerfile | Upgrades to Java 21 + Fuseki 6.2.0, adds checksum verify, runs non-root, uses --config. |
| docker/rdf-store/config.ttl | Adds server-side arq:updateTimeout and documents config rationale. |
| docker/docker-compose-quickstart/test-rdf-services.sh | Reworks RDF smoke test script (metrics + timeout test option + richer checks). |
| docker/docker-compose-quickstart/docker-compose-rdf.yml | Updates Fuseki image tag to 6.2.0 and related compose notes. |
| docker/development/docker-compose-postgres-fuseki.yml | Updates Fuseki image tag to 6.2.0. |
| docker/development/docker-compose-fuseki.yml | Updates Fuseki image tag to 6.2.0 and dev JVM guidance. |
| conf/openmetadata.yaml | Wires new RDF config fields to environment variables. |
| bootstrap/sql/migrations/native/2.0.1/postgres/schemaChanges.sql | Adds RDF failures table, timing columns, and active-dataset pointer (Postgres). |
| bootstrap/sql/migrations/native/2.0.1/mysql/schemaChanges.sql | Adds RDF failures table, guarded timing columns, and active-dataset pointer (MySQL). |
Suppressed comments (1)
openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppLogsViewer/ReindexFailures.component.tsx:79
- The drawer open effect depends on
fetchFailuresbut it isn’t listed in the dependency array, so ifappNamechanges the effect can call a stale fetcher (andentityTypescan remain from the previous app when the new run returns 0 rows). IncludefetchFailuresin the deps and clearentityTypeswhen opening.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
| Count | Rule |
|---|---|
| 5 | react-hooks/exhaustive-deps |
| 1 | openmetadata-imports/no-internal-barrel-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Settings/Applications/AppLogsViewer/AppLogsViewer.component.tsx:249:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array. Outer scope values like 'formatDateTimeWithTimezone' are |
| 🟡 | src/components/Settings/Applications/AppLogsViewer/AppLogsViewer.component.tsx:384:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Settings/Applications/AppLogsViewer/AppLogsViewer.component.tsx:401:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'scrollHeight'. Either include it or remove the dependency array. |
| 🟡 | src/components/Settings/Applications/AppLogsViewer/AppLogsViewer.component.tsx:517:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Settings/Applications/AppLogsViewer/AppLogsViewer.component.tsx:553:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/rest/rdfAPI.ts:33:1 |
openmetadata-imports/no-internal-barrel-imports |
Import the internal module directly instead of its index barrel so unrelated siblings do not enter the bundle graph. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
✅ Generated Sources Auto-UpdatedThe generated TypeScript types ( |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 70 out of 72 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppLogsViewer/ReindexFailures.component.tsx:81
- The open-on-visible effect uses
fetchFailuresbut omits it from the dependency list, which can lead to stale fetch behavior ifappNamechanges while the drawer is open and also violates the hooks exhaustive-deps rule. Additionally,entityTypesis never cleared when reopening the drawer, so if a fetch returns an empty page the dropdown can show stale entity types from a previous open/app.
…rdf-reindex-slowdown # Conflicts: # conf/openmetadata.yaml # docker/rdf-store/Dockerfile # docker/rdf-store/config.ttl # docs/generated/api-reference.md # 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/jdbi3/CollectionDAO.java # openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfRepository.java # openmetadata-service/src/main/java/org/openmetadata/service/rdf/storage/JenaFusekiStorage.java # openmetadata-service/src/main/java/org/openmetadata/service/rdf/translator/JsonLdTranslator.java # openmetadata-service/src/main/java/org/openmetadata/service/rdf/translator/RdfPropertyMapper.java # openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/rdf/distributed/RdfPartitionCalculatorTest.java # openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppLogsViewer/ReindexFailures.component.tsx
There was a problem hiding this comment.
🔵 Needs a closer look
The change set is large and touches critical RDF storage/indexing concurrency paths plus platform wiring, and I found correctness issues that should be fixed before a safe merge.
Review details
- Files reviewed: 95/216 changed files
- Comments generated: 2
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
There’s at least one correctness issue in RdfProjectionHealth.flushLocalFailures() that can throw unexpectedly, and the new maxRetries field introduces an API ambiguity with existing app configs that should be resolved before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 79/226 changed files
- Comments generated: 1
- Review effort level: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
RdfProjectionHealth.flushLocalFailures can throw on shared-store write failures and propagate through failureVersion()/initialize(), turning a recoverable persistence issue into a hard failure.
Review details
- Files reviewed: 79/227 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
Addressed the seven outstanding review threads in
Validation: 696 selected service tests passed in the reactor build, plus the final focused health regressions. Across the focused runs, 22 MySQL/PostgreSQL live-recovery cases, 9 real Fuseki authorization cases, and 6 application/API cases pass. Java formatting, UI lint/format/license/i18n, schema/model generation, and pre-commit checks pass. All SQL changes remain in unreleased 2.0.2 for both databases. The PR description includes these fixes and validation. The separately documented metadata-commit/enqueue crash gap remains; this is not a transactional-outbox change. |
There was a problem hiding this comment.
🔵 Needs a closer look
It spans large, cross-cutting RDF indexing/storage/ontology changes across multiple modules (service, UI, spec, docker) where final maintainer validation is needed beyond automated checks.
Review details
- Files reviewed: 80/232 changed files
- Comments generated: 0 new
- Review effort level: Lite
Code Review ✅ Approved 11 resolved / 11 findingsSingle-writer RDF reindex pipeline and Jena 6.2.0 upgrade addressing #32057. Batched writes around TDB2's single-writer constraint, durable live queue with retry and dead-letter storage, blue/green rebuilds with preserved serving dataset, and shared lineage vocabulary between writer and published ontology. Scale validation on 200k tables and 2M edges shows 30-minute rebuild with zero data loss and warm-query latencies under 20ms. Ten critical issues resolved: Fuseki /$/metrics access control, unionDefaultGraph config, append error handling, cron thread blocking, virtual thread pooling, batch-failing entity conversion, processTimeMs measurement, shared pool starvation, full-text index on blue/green datasets, and poison queue entry recovery. Remaining durability gap: metadata commit and RDF queue insertion are separate transactions; transactional outbox not implemented. HA, multi-node scaling, and live-ingestion throughput remain unvalidated. ✅ 11 resolved✅ Security: Fuseki /$/metrics exposed anonymously
✅ Bug: config.ttl adds unionDefaultGraph, reversing prior explicit warning
✅ Edge Case: Streaming append body-producer errors are silently swallowed
✅ Performance: Cron RDF reindex holds its execution thread blocked up to 3h
✅ Quality: Virtual threads pooled as fixed core threads in TRANSLATE_EXECUTOR
...and 6 more resolved from earlier reviews OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
There was a problem hiding this comment.
🔵 Needs a closer look
Legacy lineage compatibility is broken in several SPARQL paths because downstream traversal uses om:UPSTREAM instead of ^om:UPSTREAM (and equivalent reversals), so older datasets can silently miss downstream edges.
Review details
- Files reviewed: 81/235 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
|
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |



Describe your changes
Fixes #32057
An RDF recreate run on 1.13 took 164 hours for about 168k records (0.2 records/s) and permanently lost 11,942 records. The indexing app now batches writes around TDB2's single-writer constraint, retains per-entity failures, and supports blue/green rebuilds that preserve the serving dataset until promotion. Live hooks persist retryable operations in SQL, and the writer and published ontology use the same lineage vocabulary.
The reported ontology, backpressure, and restart-health cases are addressed. A durability gap remains between committing metadata and inserting its RDF command into the queue, detailed below. The scale validation establishes capacity for the measured configuration; live-ingestion throughput, multi-node scaling, and Fuseki HA remain unvalidated.
Type of change
High-level design
VALUES/UNION, use at most one WHERE-bearing operation, and appendINSERT DATAin the same transaction.RdfUpdater,RdfLiveWriter, andRdfLiveWriteStorepersist commands after metadata commits. A SQL fence permits one live consumer across servers. Rejected executor tasks and failed Fuseki operations retain their queue entries; retries preserve order with backoff capped at 60 seconds. After ten failed deliveries, a command moves to durable dead-letter storage in the same SQL transaction that advances the queue and marks shared health degraded. It is never replayed behind later writes; a covering full rebuild reconciles it. Entity replay reads current metadata instead of storing entity snapshots or service credentials in the queue.RdfProjectionHealthandRdfProjectionStateResolverread shared SQL health and queue state. Failed or overdue queued writes produceDEGRADED; successful replay clears that condition without reindexing. Separate unrecoverable failures use versioned repair markers so a rebuild cannot acknowledge a newer failure. Failed local-health flushes retain their markers for retry without aborting RDF initialization or reporting a healthy projection.RdfLineagecentralizes canonical lineage direction. The ontology declares written predicates and marks unprojected vocabulary terms explicitly. Custom extension keys are stored as values under a fixed vocabulary rather than dynamically creating core predicates.relationshipIsolationMaxFailures(default 3; zero disables isolation). It counts failed per-source writes across an isolation pass; successful writes do not consume it. It is independent of Search/HTTPmaxRetriesand live queue delivery attempts. Java, Python, TypeScript, resolved UI schemas and generated app docs use the separate field.TRIGGER_TYPE_KEY. Heavy indexing apps skip every missed trigger regardless of hourly, daily or weekly cron frequency. Writer permissions for/uploadnow match across the primary and A/B Fuseki datasets.Design and operating details: production runbook, ontology contract.
Coverage of the linked reports
output om:upstream source,source om:downstream output, andoutput prov:wasDerivedFrom source. Readers retain legacy uppercase compatibility. The invalid equivalence todcat:qualifiedRelationis removed. Bidirectional contract tests require written predicates to be declared and declarations to be projected or explicitly annotated as inference-only. Tests include deliberate contract mismatches, direct queries with inference disabled, reasoning, legacy cleanup, repeated rebuilding, and live deletion.DEGRADEDfollowed byREADYafter replay.Remaining durability gap
The metadata transaction and RDF queue insertion are still separate transactions. A process crash after metadata commits but before enqueueing, or a SQL outage that prevents enqueueing, can leave an update without a recovery record. Enqueue failures degrade persisted health when SQL is available; if that health write also fails, the process retries its local marker only while it remains alive. A restart before persistence can therefore lose that marker too.
Closing this gap requires persisting the RDF command atomically with the metadata transaction, using a transactional outbox. This PR does not implement that step or claim complete delivery across this interval. Writes already dropped by older releases still need a one-time rebuild. Unacknowledged queue entries are retained, so prolonged outages require monitoring SQL disk, queue depth, and queue lag; an invalid command blocks later work for at most ten failed deliveries before moving to dead-letter storage. The failed payload, attempt count, error and failure version remain inspectable; shared health stays degraded until a covering full rebuild. Dead-letter persistence failures roll back both queue advancement and the health update.
Scale validation
The full application/PostgreSQL/Fuseki scenario passed on
f6c678788c12c79763f5b72723d6df5dbbf707b6, from 2026-09-08 22:25:46 to 23:37:59 UTC. This is the measured revision, preceding the final semantic-inference label fix ate06d1510ee.The source fixture contained 200,000 tables, 2,386,000 columns, and 2,000,000 distinct acyclic lineage edges. Independent graph counts verified 200k tables, 2M triples for each of the three lineage predicates, 20k detailed edges, 400 extension entries, and 26,952,284 total triples. These counts matched after both rebuilds and Fuseki restart. The column count describes the source fixture, rather than a separate graph assertion. Source seeding took 547.036 seconds and is excluded from rebuild timings.
The scenario uses one application process, one metadata database, and one Fuseki instance. Distributed mode exercises coordinator/worker partitioning within that process. Fuseki HA, multi-node scaling, live-ingestion throughput, cold-cache queries, and a controlled speedup comparison against
mainare not established by these results.Full report, charts, and reproduction instructions · Raw measurements and SHA-256 manifest
Tests
Use cases covered
Scheduled and live writer serialization while reads continue; timeout cancellation; ontology predicate agreement and lineage direction; durable backlog/retry recovery; shared projection status; repeated rebuilds and legacy cleanup; quoted glossary-tag patches; partition ownership, heartbeats, and worker shutdown; cancellation, promotion, and restart integrity at full catalog size.
Unit tests
JwtFilterTestcases. The new cases cover access during refresh, absolute and idle expiry, pending/revoked/expired states, mismatched or missing usernames, and decommissioned authentication providers.JwtFilterclass, below the 90% whole-class target; this fix does not claim complete authentication coverage.RdfLiveWriteStore108/109 lines (99.1%),RdfProjectionHealth47/48 (97.9%), andRdfIndexingRunContext24/24 (100%). The 90% whole-class target remains unmet for several existing large app/scheduler classes; these percentages do not describe whole-PR coverage.openmetadata-service/src/test/java/org/openmetadata/service/rdf/:RdfOntologyContractTest(7) andRdfLineageOntologyTest(10) passed. They project real Jena models and execute generated queries/updates, with negative contract checks and RDFS/OWL assertions.DistributedRdfIndexExecutorTestandRdfPartitionHeartbeatTest, plusRdfScaleResourcesTestin the integration-test module.e06d1510ee,SemanticSearchEngineTest(14) andOntologyDocumentTest(3) passed: 17 tests, zero failures/errors/skips. Semantic inference returns canonicalom:upstreamlabels while reading canonical, inverse, PROV, legacy, and transitive paths. The ontology resource test expects version 2.0.2, correcting the older CI failure.buildInferenceQuery. This is method coverage; full changed-class coverage across the PR has not been established.Backend integration tests
Latest review verification covered 37 passing integration cases across focused runs (22 live recovery + 9 authorization + 3 batch parity + 3 live projection). The corrected deletion assertions accept the storage API's null result for a missing entity; the final eight-case MySQL/PostgreSQL rerun also verifies retained dead-letter fields. Java formatting, UI lint/format/license/i18n, official model/schema/app-doc generation and pre-commit checks pass.
The subsequent CI authentication fix passed all 10
SessionMultiNodeITcases on each of MySQL and PostgreSQL (20 total). The refresh-race case now asserts a successful authenticated request from another server while the SQL session isREFRESHING, unchanged lease/version, and the existing 503/Retry-Afterresponse for a competing refresh. The suite also verifies cross-server revocation, expiry, session limits, and reuse of tokens issued before refresh. Java formatting and pre-commit checks pass for this fix.Tests under
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/include:RdfLiveWriteRecoveryIT: 22 passing cases across MySQL and PostgreSQL, covering backlog persistence, ordered retry, competing consumers, producer progress during slow writes, replay after a simulated post-Fuseki-commit crash, shared health, and migration reapplication. New cases exercise ten-attempt dead lettering, retained payload/error/attempt/failure-version data, queue progress, rebuild version fencing, prevention of resurrection after a later delete, and rollback when dead-letter persistence fails.RdfFusekiAuthorizationIT: 9 passing cases against real Fuseki. Writer/admin authorization agrees for all three/uploadroutes and anonymous uploads are rejected. Actual Turtle uploads through Graph Store/dataare verified with SPARQL. The shipped primary assembler omits the legacy/uploadhandler, so the authorization check accepts its 405 response; this PR does not add that handler.RdfBatchFieldsIT: 3 passing cases verify batch/read parity, inherited fields, and team hierarchy. The hierarchy case adds an orphan relationship and confirms that missing teams never become null children.batchResolveRefseither resolves every requested ID or throws; child discovery already excludes missing/deleted teams.RdfLiveProjectionIT: 3 passing cases, exercising real metadata requests, the public status API, live recovery without reindexing, persisted failure state, and quoted glossary-tag patches.RdfPartitionLeaseIT: 9 passing cases on each database, covering stale claims and active heartbeats through coordinator and worker paths.RdfReindexInsertOnlyIT: live canonical lineage, seeded legacy triples/ontology, repeated full rebuilds, and live deletion, checked through SPARQL withinference=none.scripts/rdf-catalog-scale.shscenario and the 2,000-table/20,000-edge smoke scenario passed. The full scale scenario is opt-in and is not represented as an ordinary CI test.Ingestion integration tests
Not applicable: ingestion connector behavior is unchanged.
UI and Playwright tests
The failures drawer has unit regression coverage in
ReindexFailures.test.tsx. The existing RDF Knowledge Graph/Ontology Playwright workflow and the general Playwright summary passed one06d1510ee. No new Playwright spec is included in this PR.The visual regression failure on
4f05f8f2captured the sign-in page instead of Data Quality:GET /users/loggedInUserreturned401 Invalid session, then refresh succeeded for the same unexpired session. JWT validation rejected the temporaryREFRESHINGstate. A deterministic two-server regression reproduced that exact 401 before the fix. Existing access tokens now remain valid while another request holds the refresh lease; session expiry, revocation, user matching, and provider validation still apply. The screenshot baseline and comparison threshold are unchanged.Manual testing performed
Ran the dedicated scale launcher with the configuration above: seed the catalog, trigger local rebuilding, query the populated serving dataset, cancel a distributed rebuild, recover while querying, restart Fuseki, and compare graph counts. This invokes real application APIs and isolated database/Fuseki containers. Reproduction commands and raw observations are linked above.
Current CI
The authentication-race fix is pushed as
3c2ec7705989d998d905ef69934c0395306aacfa. CI has restarted for this revision; the new visual regression run is pending. The earlier green result below does not cover this commit. Current checks.Before the latest review fixes, revision
e06d1510ee212f61e631a3abe309b3ba45437e05had 159 successful checks, 21 skipped, zero failures, and none pending, including service unit tests, Collate Maven, Java/UI checkstyle, and RDF Playwright. Checks for this revision.Other behavior changes
Failure filtering validates
entityTypebefore querying SQL; dataset redirects encode their path segment;/$/metricsremains authenticated; background scheduling keeps polling responsive; and the failures drawer rejects stale responses when the selected app changes. Batch projection includes role/team/type fields and uses stable custom-property definition IDs with owned-data cleanup.Migration / rollout
bootstrap/sql/migrations/native/2.0.2/for both MySQL and PostgreSQL. There are no RDF migration changes in 2.0.3. These include durable live queue/shared health/dead-letter tables and indexing timing columns. MySQL timing-column additions use distinct prepared statement names so migration deduplication does not omit later columns; reapplication is idempotent./fuseki-data/openmetadata. Deployments using the former root--loc=/fuseki-datalayout must move their rootData-*generations and lock files into that directory while Fuseki is stopped. Startup rejects the unmigrated layout and prints migration instructions.RdfIndexApprebuild withrecreateIndex=trueafter upgrading to 2.0.2 to refresh the ontology and replace untouched legacy lineage/extension data. Query custom extensions throughhasExtension/hasExtensionProperty/extensionKey/extensionValue. Legacy lineage remains readable during transition.replicas: 1; restart persistence and rebuild isolation do not provide store HA.UI screen recording / screenshots
TODO: attach a recording/screenshots for the failures-drawer changes. No visual recording is attached to this description.
Checklist
Fixes #32057.