Repository navigation
Fixes #36440: Report the RDF graph as not ready after the server ran with RDF off (backport 2.1 #37703) - #37876
Conversation
…with RDF off (#37703) * Fixes #36440: Rebuild the RDF graph after the server ran with RDF off With RDF off nothing reaches the graph and nothing is recorded, so after RDF is turned on (again, or for the first time on an existing install) the projection reported READY from an old or empty run and the agent SPARQL path served stale or missing data. - RdfIndexApp flags a run that finds RDF off as projectionUnchanged, so it no longer counts as a build of the graph. - A server that starts with RDF off records the time in rdf_projection_health.rdfDisabledAt (new column, MySQL and Postgres). - The projection is DEGRADED while the newest indexing run predates that mark, and server start queues one RdfIndexApp run when nothing has indexed since. * Degrade the projection on an RDF-off start instead of comparing times Review of the first commit found that deciding the state by comparing rdfDisabledAt with the newest run's start time let any successful run after the mark, a partial or non-recreate one included, read as READY over a graph that still missed the changes. The RDF-off start now also raises failureVersion in the same statement, so the existing health check reports DEGRADED and only a completed rebuild of the entire projection that started afterwards repairs it. rdfDisabledAt stays as the key that decides whether start-up queues a run. Status reads no longer run an extra query for the mark. RdfFirstIndexRunIT covers the wiring end to end on the suite server. * Cover the full-rebuild guard and repair the tests the RDF-off bump reaches Second review pass on the branch: - RdfLiveProjectionIT runs on a suite server that starts with RDF off, which now degrades the projection; its fabricated completed rebuild repairs the health row as a real one would. - RdfIndexAppTest pins that a recreate of some entity types and an incremental run leave the projection degraded, and the RDF-off run's record now starts after the mark so only the flag can discount it. - RdfFirstIndexRunIT loads the app as AppResource does (with its bot) and adds the incremental-run case end to end. * Keep the original Deciders line on the 2026-11-06 RDF decision record * Say to run a full Recreate after turning RDF on with a rolling restart * Record the RDF-off mark again when the server stops A server with RDF off drops its writes for as long as it runs. During a rolling restart that turns RDF on, the new server's start-up rebuild began after the old server's start mark, so on completion it repaired the projection and reported READY over a graph that could miss the old server's last writes. The stop mark raises failureVersion after that rebuild read it, so the state stays DEGRADED until another full rebuild. Also write the start mark after migration validation, since it uses a column a pending migration adds, and assert in the RDF-off test lane that a server start records the mark. * Narrow the recorded upgrade gap to databases already at 2.1.0 The 2.1.0 migration deletes earlier RdfIndexApp run records, so an upgrade from 2.0.x that turns RDF on in the same deploy takes the first-install path and queues the start-up run. Seen live from 2.0.8. * Test the RDF-off marks on a real server start and stop RdfDisabledMarkLifecycleIT starts a second server process with RDF off on the suite database, stops it, and checks that both the start and the stop moved the mark, so removing either call fails a test. ForkedServerNode gains a stop that reports whether the process exited by itself. The setup guide and the decision record said the state stays DEGRADED after a rolling enablement. It reads READY while the old server is still up after the rebuild completed; both now say so, and comments that described a start only cover the stop too. * Record the RDF-off mark when the stop begins as well The stop mark was written near the end of shutdown. Jetty waits up to 30 s for open requests first and Kubernetes kills a pod after 30 s by default, so a slow shutdown could be killed before the mark was written. A Jetty lifecycle listener now writes it when the stop begins; the later hook stays, to follow the writes made while the server drained. * Bound the RDF-off write at the start of a stop to five seconds Nothing has stopped yet when the stop begins, so a database that does not answer would hold the shutdown for its whole connection timeout and the platform would kill the server before any hook ran. The write now gives up after 5 s; the one at the end of the stop is unchanged. The lifecycle test closes its server in a finally, and the decision record lists the case of a server killed while it drains. * Keep ALTER DATABASE the last statement of the 2.1.0 MySQL migration FlowableCharsetMigrationTest requires it to be last, because Flowable's own schema upgrade runs after this file and inherits the database default. The rdfDisabledAt statements were appended after it; they now sit above it, unchanged. * Drop the start-up rebuild after RDF was off; keep the not-ready mark A server with RDF off still marks the projection as not ready when it starts, when its stop begins and at the end of its stop, and an RdfIndexApp run that finds RDF off is stored as a success flagged projectionUnchanged, which the state resolver skips. After RDF was off the agent SPARQL path refuses until a rebuild of the entire projection completes. The start-up rebuild queued when nothing had indexed since RDF was last off is removed: the rebuild after enabling RDF is an explicit step, like search reindexing. The start-up rule on main stays as it is (one run when no RdfIndexApp run record exists). The rdfDisabledAt column only fed that queue, so it and its migration statements are removed and the pull request makes no schema change. * Do not name reindex-rdf as the rebuild step after enabling RDF The ops CLI command never initializes the app scheduler, so it stops before it queues a run. The setup guide and the decision record now name the application page and the API only, and say why the CLI cannot do it today. (cherry picked from commit 13bdcdc)
* test(rdf): simulate failure after a skipped run * test(rdf): map the unit-only fixture precisely (cherry picked from commit d4de630)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
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 (5)
Commandsmvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=OpenMetadataApplicationTest,RdfDisabledMarkTest,RdfIndexAppTest,RdfProjectionStateResolverTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=global-state -Dit.test=RdfDisabledMarkLifecycleIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=rdf -Dit.test=RdfFirstIndexRunIT,RdfLiveProjectionIT,RdfLiveWriteRecoveryIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false |
Code Review ✅ Approved 🟡 Medium riskRecording RDF-disabled lifecycles and skipping no-op indexing changes readiness; failed health writes could leave stale graphs available through agent SPARQL. Backports the RDF projection health fix to 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 |
| void recordsWhenThereIsNoRdfConfiguration() { | ||
| RdfDisabledMark.recordIfDisabled(null, store); | ||
|
|
||
| verify(store).recordRdfDisabled(); |
There was a problem hiding this comment.
Several new tests in RdfDisabledMarkTest only check verify(store).recordRdfDisabled(). The repository guide requires tests to assert observable results, not internal verify() calls. Check the stored failureVersion instead, so these tests prove that the graph was marked as needing a rebuild. This repository requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Describe your changes:
Fixes #36440
Backports #37703 to
2.1. #37703 fixed the issue onmain; this carries the fix to the release branch.Why 2.1 needs it. #37155 is already on
2.1: anRdfIndexApprun on a server with RDF off is stored as a success with nothing indexed. Without #37703 that record reads asREADY, so turning RDF on for the first time on an existing install reports a ready graph that was never built, and the agent SPARQL path answers from it (0 tables with HTTP 200 in the reproduction). #37703 has to ship in the same release as #37155.What #37703 does. A server with RDF off raises
failureVersioninrdf_projection_healthwhen it starts, when its stop begins and at the end of its stop, and anRdfIndexApprun that finds RDF off is flaggedprojectionUnchangedso the state resolver skips it. After RDF was off,/v1/rdf/statusreportsDEGRADED(orREBUILDINGwhen the graph was never built) and the agent path refuses until a fullRdfIndexAppRecreate completes. It queues no rebuild and adds no migration; the design, known gaps and live verification are in #37703.What is in this PR.
13bdcdcfbf6, the squash of Fixes #36440: Report the RDF graph as not ready after the server ran with RDF off #37703, cherry-picked with-x. One conflict, inopenmetadata-integration-tests/pom.xml:2.1has its ownglobalStateTestslist on the line next tomultiNodeTests. I kept the2.1lists and added onlyRdfDisabledMarkLifecycleITtomultiNodeTests; its include and exclude entries applied cleanly.cc426978819(test(rdf): fix realFailureAfterASkippedRunStillMarksTheProjectionDegraded on main #37716) andd4de63041d6(test(rdf): strengthen failure-after-skip assertions #37697), both test-only, cherry-picked with-x.RdfIndexAppTest$RunLockTests.realFailureAfterASkippedRunStillMarksTheProjectionDegradedfails on2.1without them ("expected: but was: "): it used "RDF off" as its stand-in for a real failure, which fix(rdf): complete RdfIndexApp with nothing indexed when RDF is not configured #37155 turned into a success. That failure is on2.1today, independent of this backport; these two commits are howmainfixed it.Type of change:
Tests:
Run locally on this branch (
14f408d5995, baseorigin/2.1):RdfLiveProjectionITin theparallellane (suite server with RDF off, MySQL + Elasticsearch): 3 run, 0 failed.Local Java test run: PASSED
14f408d59958(baseorigin/2.1)--scope full).Not run on this branch: the live Docker cases (they ran on the
mainbuild and are recorded in #37703), the full test scope, coverage.Manual testing performed
None on the
2.1build. See #37703 for the live runs onmain.UI screen recording:
Not applicable — backend-only bug fix, no UI change.
Checklist:
<original title> (backport 2.1 #37703).Fixes #36440above (closed by Fixes #36440: Report the RDF graph as not ready after the server ran with RDF off #37703 onmain; this PR carries the fix to2.1).main(Fixes #36440: Report the RDF graph as not ready after the server ran with RDF off #37703, test(rdf): fix realFailureAfterASkippedRunStillMarksTheProjectionDegraded on main #37716, test(rdf): strengthen failure-after-skip assertions #37697). The only hand edit is thepom.xmlconflict described above.docs/decisions/2026-11-02-server-start-queues-one-rdf-index-run-when-none-exists.mdanddocs/decisions/2026-11-06-an-rdf-index-run-that-ends-before-indexing-leaves-the-projection-state-alone.mdfrom Fixes #36440: Report the RDF graph as not ready after the server ran with RDF off #37703.🤖 Generated with Claude Code
https://claude.ai/code/session_01M4KprRYxz12aRpRZeqousD
The existing test requirement must be satisfied before merging.
Findings
Summary
Backports RDF readiness safeguards to 2.1. Servers that run with RDF off leave the graph needing a full rebuild before agent queries resume.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Server runs with RDF off] --> B[Start and stop raise failureVersion] B --> C[Graph needs repair] D[Index run finds RDF off] --> E[Resolver skips the run] C --> F[Agent queries refused] E --> F G[Full Recreate after the last mark] --> H[Rebuild completes] H --> I[Graph can become READY]Reviews (5) · Last reviewed commit: "Merge branch '2.1' into fmcardoso/backpo..." · Reviewed by Greptile