Repository navigation
Fixes #38698: Draw Dashboard to Chart lineage on the server instead of in ingestion - #38914
Conversation
❌ 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 |
Main made every lineage write one LineageWriteTransaction that takes its guard-row locks first. The dashboard chart batch write now runs through it and locks the edge before it locks or reads the dashboard and chart; its search, cache and RDF projections still run after commit.
|
Merged main into this branch (a24e251). Main now runs every lineage write as one Ran locally on a24e251, MySQL + Elasticsearch:
|
|
Hi @Vamsi-klu, thanks for the work on this. We discussed it with the backend team. We'd like to change the approach before reviewing further. The server already stores which charts belong to a dashboard, as the Could you rework the PR this way?
This also gives the edge to dashboards created through the API, which today never get it. Testing. Please test it end to end and share the evidence in the PR description:
|
The 2.1 ingestion stage read every dashboard back and wrote one lineage request per chart, which slowed dashboard ingestion (open-metadata#38698). The server already holds the same set as the Dashboard HAS Chart relationship. - DashboardRepository reconciles a dashboard's chart edges after its create, bulk create or chart change commits, through LineageRepository. - The edges carry a new DashboardChartLineage source, so an overrideLineage run no longer deletes them. - The 2.1.2 migration adds the missing edges and moves the edges the 2.1 stage drew to the new source. - Ingestion drops the yield_dashboard_chart_lineage stage. - Replaces the batch lineage endpoint proposed earlier in this PR. ADR:2026-12-04-the-server-owns-dashboard-to-chart-lineage
The sync runs as a post-commit action that only logs, so any failure escaping it dropped the edges of every dashboard left in a bulk write. Each dashboard and each edge write now catches and logs its own failure. A stored dashboard to chart row without details is treated as another writer's edge instead of throwing.
# Conflicts: # ingestion/src/metadata/ingestion/source/dashboard/dashboard_service.py # ingestion/tests/unit/topology/dashboard/test_dashboard_chart_lineage.py
The browser tests run with isolate:false, so the core toast queue is shared across files in a worker. Data contract suites earlier in the shard left "Data contract saved successfully" toasts over the bulk removal Delete button, and two output-port tests timed out clicking it. Each data product ports suite now runs the shared closeToasts helper before every test.
Code Review ✅ Approved 🔴 High risk 3 closed / 3 findingsThe 2.1.2 backfill and post-commit reconciliation alter stored dashboard-chart lineage edges, so failures could leave lineage relationships incomplete or stale. Moves Dashboard to Chart lineage from ingestion to the server, with a new ✅ 3 closed✅ Edge Case: A dashboard the server rejected is counted as failed a second time
✅ Bug: Committed-lineage projection holds a row lock across search/RDF I/O
✅ Bug: One dashboard's non-JDBI failure skips chart lineage for the rest of a bulk
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 |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
Describe your changes
Fixes #38698
In 2.1, dashboard ingestion drew the Dashboard → Chart lineage edges itself. For every dashboard it flushed the sink, read the dashboard back and wrote one lineage request per chart, which made dashboard ingestion much slower. The server already stores the same set as the
Dashboard HAS Chartrelationship, so ingestion was copying server data back to the server.Following the backend discussion, this PR now moves those edges to the server and drops the batch API proposed earlier in this PR.
Type of change
Decision (ADR:2026-12-04-the-server-owns-dashboard-to-chart-lineage)
The server keeps one Dashboard → Chart lineage edge for every chart a dashboard holds, and ingestion no longer draws them.
DashboardChartLineagesource. AnoverrideLineagerun deletes theDashboardLineageedges into a chart before writing its own. The server only redraws an edge when the dashboard's charts change, so a shared source would lose the edge for good.DashboardLineagesource) to the new source.How
overrideLineagebehavesNothing changes for connector lineage. An override still deletes the edges of the source its connector writes and redraws them, as in ADR:2026-11-09-dbt-override-lineage-deletes-when-the-manifest-declares-no-parent and ADR:2026-11-25-direct-chart-lineage-is-a-dashboard-pipeline-option. The sink and lineage code paths are unchanged.
The server's Dashboard → Chart edges are no longer connector edges, so an override leaves them alone. They still never go stale: when ingestion saves a dashboard, the server removes the edge of any chart that left it, on every run.
Changes
DashboardChartLineageSyncis wired intoDashboardRepository(create, bulk create and chart changes). It writes throughLineageRepository, so search, RDF, domain rollups and change events all apply.LineageSourcegainsDashboardChartLineage(schema, generated TS, UI label).DashboardChartLineageBackfillworks on rows only, for MySQL and Postgres.yield_dashboard_chart_lineagestage. The tableau and ssrs ingestion ITs now expect the new source./capability, the 4 batch schemas, the search and DAO additions, and the ingestion batch client.Upgrade note: run
./bootstrap/openmetadata-ops.sh reindex --entities=chartafter upgrading, so the lineage views show the backfilled edges. The 2.1.2 lineage rebuild steps already need a reindex.Tests
DashboardChartLineageIT(API create, PATCH, PUT, bulk create, another writer's edge kept, override delete keeps the edge, search shows the edge)DashboardChartLineageBackfillMigrationIT(missing edge, stage edge adopted, query/manual edges kept, released chart untouched, no-op second run)DashboardResourceIT(regression)Unit tests:
DashboardChartLineageBackfillTest9 / 0,MigrationArchitectureTest2 / 0,MigrationTestpass.Ingestion unit tests (dashboard topology and lineage edge cache): 1645 passed.
The migration IT caught one bug, now fixed:
JsonNode.isEmpty()is true for scalars, so an edge with asqlQuerywould have been taken as a stage edge.Playwright on a local server built from this branch, with sample data loaded:
LineageInteraction,LineageControlsandLineageRightPanel(Basic) 45 / 45;Dashboards.spec.ts4 / 4 (chromium + Basic). The sample data's dashboards got oneDashboardChartLineageedge per chart.Browser tests:
DataProductAssetsOutputPortstimed out on this PR because data contract suites earlier in the shard left toasts over the Delete button (the browser tests run withisolate:false). The three data product ports suites now run the sharedcloseToastshelper before each test. Reproduced locally, then 49 / 49 with the fix.Merged main: Fixes 5974, 5972, 5977: migrate Redash, PowerBI and Tableau CLI E2E to v2 #39762 had changed the removed stage and added a PowerBI override of it. Both are removed here, because the server now draws the edges for every dashboard of a bulk write.
Live verification
A local server built from this branch (MySQL + Elasticsearch) ran the real tableau and ssrs ingestion workflows: a first run, a rerun and an
overrideLineagererun. Both runs passed 26 / 26.The same workflows on the same server, compared between main's ingestion and this branch:
GET /dashboards/name/…GET /lineage/getLineageEdge/…DELETE /lineage/chart/{id}/type/DashboardLineage(override)Main's override run sent those 8 deletes against the server's edges, and its override test still passed. A real override run leaves them in place.
A dashboard created through the REST API (no ingestion) with 3 charts:
After a PUT that drops
top_customersfrom the dashboard, its edge is removed:After
DELETE /lineage/chart/{id}/type/DashboardLineage, the call an override run makes, the edges stay:Backend integration tests
UI screen recording
Server and ingestion change. The screenshots above show the lineage view.
Checklist
REVIEW.md.plan_local_java_tests.py --check-branch).🤖 Generated with Claude Code