Repository navigation
Fixes 35198: Keep RDF reasoning freshness exact during rolling upgrades and failed updates - #35199
Conversation
Servers that predate rdf_projection_health.enqueuedWatermark enqueue without recording it, so the watermark counted their writes only through MAX(id) of the queue. Once such a row was delivered or dead-lettered it dropped out, and a reasoning result captured before it could pass for current. Record the ID in the same transaction that deletes the row. Document the gap that remains while older servers still drain the queue or promote a blue/green build.
The test copied the production watermark SQL instead of calling RdfLiveWriteStore.enqueuedWatermark(), and its assertions held for any live write that happened to be enqueued meanwhile. Pause delivery by holding the drain guard, so queued live writes stay visible, and count exactly the queue IDs that left no row behind.
The admin SPARQL Update and pipeline-status provenance writes recorded themselves only after executeSparqlUpdate returned. A failure that arrives after Fuseki applied the update, such as a response timeout, recorded nothing, so earlier reasoning results kept passing for current. Record in a finally block, as RdfIndexApp already does.
setActiveDataset, upsertActiveDataset and clearActiveDataset have no callers; RdfRebuildStore owns every write to rdf_active_dataset.
CHECK needs ontologyIri and check, EXPLAIN needs ontologyIri and explain, REFRESH needs ruleBundleDigest, and each check kind needs its expressions. These were only described in prose. The generated Java and TypeScript models are unchanged.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
Add decision records for the per-operation fields the job request schema enforces, which the store's validator in open-metadata/jena also checks, and for the two single writers freshness relies on: queue rows leave only through RdfLiveWriteStore.retire, and RdfRebuildStore alone writes rdf_active_dataset. Cite them from the code that implements them.
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · Recording failed RDF updates and retiring legacy queue IDs changes freshness tracking; missed watermark updates could let stale reasoning results appear current. Tightens RDF reasoning freshness during rolling upgrades and failed updates by keeping retired queue IDs in the enqueued watermark, recording untracked writes even when updates fail, and requiring per-operation fields in the reasoning job request schema. The contract and ownership rules are now recorded in docs/decisions, resolving the open documentation gap. No open issues remain. ✅ 1 closed✅ Quality: Contract and ownership rules from the PR body are not recorded in docs/decisions
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Describe your changes:
Fixes #35198
Follow-up to phase 2 (#34975) of
docs/plans/2026-10-07-fuseki-native-reasoning.md. A reasoning result decides whether it is still current from the live-write watermark; this closes the cases where the watermark missed a write, and makes the job-request schema enforce what each operation needs.Type of change:
High-level design:
RdfLiveWriteStore.retire(handle, id)deletes a queue row and raisesrdf_projection_health.enqueuedWatermarkto its ID in the same transaction. Delivery, dead-lettering andrecordUntrackedWriteall use it, so a row inserted by a server on the previous version (which never raised the column) no longer drops out of the watermark once drained. Two gaps remain during a rolling upgrade and are documented inrdf-production-setup.mdand the plan: an older server draining its own write, and an older server promoting a blue/green build without a new generation.RdfSparqlService.updateandPipelineRepositoryrecord the untracked write in afinally; an update that timed out may still have been applied by Fuseki.recordUntrackedWritenever throws, so it cannot mask the original error.rdfReasoningJobRequest.jsonas draft 2020-12allOf/if/then(thesnowplowConnection.jsonprecedent): REFRESH needsruleBundleDigest; CHECK needsontologyIriandcheck; EXPLAIN needsontologyIriandexplain; SATISFIABILITY, SUBSUMPTION and ENTAILMENT need their expressions. Generated Java and TypeScript are byte-identical.RdfActiveDatasetDAO.setActiveDataset,upsertActiveDatasetandclearActiveDataset, which have no callers;RdfRebuildStoreowns every write to the table.Not done: comparing the dataset name in
ReasoningFreshnesswould add a field to the mergedRdfSourceRevisionprotocol; nothing callsReasoningFreshnessin production yet, so it is documented as an upgrade limitation instead.Tests:
Use cases covered
UNKNOWN.Unit tests
RdfReasoningContractTest(43),RdfUpdaterTest(12),ReasoningFreshnessTest(7),RdfSparqlServiceTest(12),RdfProjectionHealthTest(3): 0 failures. The new cases fail on the previous code.PipelineRepositoryhas no new test: it reachesRdfRepositorythrough a static singleton; the change mirrors the testedRdfSparqlServiceone.Backend integration tests
RdfLiveWriteRecoveryIT(new older-server cases, which fail on the previousRdfLiveWriteStore),RdfSourceRevisionIT(now readsRdfLiveWriteStore.enqueuedWatermark()and counts IDs without a queue row).RdfBlueGreenRebuildITRdfLiveWriteRecoveryITRdfSourceRevisionITManual testing performed
None beyond the tests above.
UI screen recording:
Not applicable — backend-only change.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.rdfReasoningJobRequest.jsongains validation rules only; generated code is unchanged.