OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

RDF store lifecycle — recreate, incremental update, failure recovery

Open pmbrull opened this issue 3 months ago • 1 comments

Part of the Ontology Studio EPIC.

What

The RDF store cannot currently be rebuilt in place — #31105 fails outright when "Recreate RDF Store" is unselected.

  • Recreate and incremental update paths, both working.
  • The failure modes that today need a full rebuild, handled without one.
  • Status visible to an operator: what ran, what failed, why.

Done when

  • #31105 is fixed with a regression test covering both the recreate and the non-recreate path.
  • An incremental ontology change reaches the store without a full rebuild.

pmbrull avatar Aug 25 '26 14:08 pmbrull

Two concrete instances for this issue's scope, found while working #32048. Verified against main @ 957d0c3fa5.

1. Writes are silently dropped under backpressure, and only a full rebuild recovers

RdfUpdater bounds pending writes with a semaphore of 1000 (RdfUpdater.java:48). When it is exhausted, acquireQueuePermit (:265) waits QUEUE_FULL_WAIT_SECONDS = 30 (:49) and then discards the write — recordDroppedWrite (:277) increments a counter, emits a log line every hundredth drop, and calls RdfProjectionHealth.markDegraded().

The HTTP request that caused it succeeded long before, so the caller is never told. Nothing retries. This is the asymmetry with the search path, which self-enqueues on failure (see the note at EntityRepository.java:5353).

Recovery is a full reprojection: the only markReady() call is in RdfIndexApp (RdfIndexApp.java:799). One dropped write therefore costs a complete rebuild — exactly the "failure modes that today need a full rebuild, handled without one" this issue names.

Worth noting the drop policy may well be a deliberate trade (protecting the request path from a slow triplestore). The gap is that it is silent and unrecoverable except by rebuild, not that it exists.

2. The projection-health signal does not survive a restart

RdfProjectionHealth holds a private static final AtomicBoolean initialised to false (RdfProjectionHealth.java:19). RdfProjectionStateResolver combines it with the persisted app-run state (:48):

return persistedState == RdfProjectionState.READY && RdfProjectionHealth.isDegraded()
    ? RdfProjectionState.DEGRADED
    : persistedState;

The persisted half is shared; the runtime-degraded half is process memory. So after a server restart the flag is back to false while the last RdfIndexApp run still records SUCCESS — and GET /v1/rdf/status reports READY even though the graph is still missing everything that was dropped before the bounce. That holds on a single instance; it also is not shared across instances on a server configured to run clustered (org.quartz.jobStore.isClustered=true in AppScheduler.java:73 and EventSubscriptionScheduler.java:114).

For the "status visible to an operator" goal, the degraded signal needs to be shared state — persisted, or aggregated across instances — rather than a process-local boolean.

fmcardoso avatar Sep 07 '26 14:09 fmcardoso