Repository navigation
fix(rdf): a reindex run skipped for the lock no longer marks the projection DEGRADED - #37245
Conversation
…rks the projection DEGRADED
…t the app side of the flag
…e projection state alone
|
Local Java test run: PASSED — details
Tests run locally
Per-class counts come from the test reports, which can credit a test to the wrong class when classes run concurrently, and keep only the last run of a nested class that several test classes inherit. The summary's step totals are Maven's own counts. Broader coverage not executed by this focused run
Impacted, not run locally (2)
Commandsmvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=AgentSparqlServiceTest,RdfIndexAppTest,RdfProjectionStateResolverTest -Dsurefire.failIfNoSpecifiedTests=false |
Code Review ✅ Approved🟡 Medium risk · Flagging pre-index exits and paging past them changes RDF health reporting; incorrectly skipping a meaningful run could leave stale projection data treated as available. Stops a skipped RDF reindex run (lock held, lock unavailable, or deferred behind a search reindex) from marking the projection 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 |
Describe your changes:
Fixes the intermittent
ontology-rdf.setup.ts › assert RDF health and projection writesfailure in the Playwrightrdflane (projectionState: "DEGRADED"), seen on the Nov 4 and Nov 6 nightly runs (latest). When it fails, the 40 Ontology specs behind it do not run.Cause.
RdfProjectionStateResolverderived/rdf/statusfrom the newestRdfIndexApprun record and mappedSTOPPED/FAILEDtoDEGRADED. A run that finds the reindex lock held endsSTOPPEDby design ("redundant rather than broken"), without touching the projection. In the failing runs,docker/run_local_docker_rdf.shtriggeredRdfIndexAppwhile another run held the lock:That skip record became the newest one, so the projection read
DEGRADEDuntil the next run that indexed. The same happens in production: any redundant trigger takes agent SPARQL offline with a 503. The lock holder is the server's start-up index run (ADR:2026-11-02-server-start-queues-one-rdf-index-run-when-none-exists, since #36868) or a compaction (ADR:2026-10-28-rdf-storage-maintenance-pauses-serving-writes-and-compacts-on-a-schedule). Therdflane passed when the script's trigger came after the holder had finished, and failed when it came before.Fix.
RdfIndexAppsetsfailureContext.projectionUnchanged: trueon the three paths that end before indexing: the lock is held, the lock cannot be taken, or the run is deferred behind a search reindex. The run's own status is unchanged, so run history and alerting still show it.DEGRADED. If only flagged records exist, it reportsREBUILDING.REBUILDINGpast that, because it runs on every status read.docs/decisions/2026-11-06-an-rdf-index-run-that-ends-before-indexing-leaves-the-projection-state-alone.md.Type of change:
High-level design:
N/A — small change (two classes, plus their tests and a decision record).
Tests:
Use cases covered
READYafter an earlier completed run.DEGRADED.REBUILDING. The resolver pages past a full page of skipped runs and stops at the cap.DEGRADED, so the flag is reset for each run.Unit tests
RdfProjectionStateResolverTest: 5 new cases, plusSTOPPED → DEGRADEDin the status mapping.RdfIndexAppTest: the held-lock and deferral tests now pass the record the app pushes through the real resolver. Two new cases: lock unavailable, and a real failure after a skip.AgentSparqlServiceTest: the run-store stub no longer pins the page size.READY/REBUILDINGexpected, gotDEGRADED);projectionUnchanged = truelines fails 3 app tests;MigrationWorkflowReprocessingTest,RdfColumnLineageTraversalTest,RdfInitialIndexRunTest,RdfScheduleMigrationTest(with the above: 7 classes, 121 tests, 0 failed).Backend integration tests
Local Java test run: PASSED
bcf919da56f7(baseorigin/main)--scope full).Not run locally: the broader plan (
--scope full: 120 IT classes, including therdflane) runs in the merge queue.openmetadata-mcpunit tests that only referenceRdfIndexAppwere not run.Ingestion integration tests
Playwright (UI) tests
rdflane'sontology-rdf.setup.tsis the end-to-end check, and it runs in the merge queue.Manual testing performed
None beyond the CI log analysis above.
UI screen recording:
Not applicable — backend-only fix.
Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>— test fix, no issue (skip-pr-checks).My PR is linked to a GitHub issue via
Fixes #<issue-number>above — test fix, no issue.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: not applicable (no schema change;
failureContextalready accepts additional properties).For a UI feature or feature task: not applicable.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.bcf919da5; fixed: the app side of the flag had no test, paging had no cap, and a lock-unavailable run still degraded. No 🔴 open. Follow-up nit, already true on main: a skipped run still incrementsOntologyMetrics.recordGraphRebuildFailed.Decision check:
docs/decisions/2026-11-06-an-rdf-index-run-that-ends-before-indexing-leaves-the-projection-state-alone.md.I have added a test that covers the exact scenario we are fixing.
🤖 Generated with Claude Code