Area: Deployment Issues
Sub-Area: Elasticsearch Performance / Metadata Tests
Applies to: Cloud
Issue
Lineage views and entity detail pages load slowly, but other parts of the DataHub UI respond normally. If your DataHub Cloud instance runs Metadata Tests that evaluate a very large number of assets (for example a scorecard test across your whole warehouse), those tests add data and write activity to the index that lineage reads. This article explains how, and how to reduce it.
You Might Be Asking
- How do Metadata Tests add to the index that lineage reads?
- Do passing assets add data too, or only failing ones?
- How do I stop a test from writing results without deleting it?
- Can I run Elasticsearch maintenance or change search settings myself?
Cause
Metadata Tests are a DataHub Cloud feature. When result tracking is on, a test stores its result on every asset it evaluates, in the asset's testResults aspect. Result tracking is on for existing tests and for tests that have no actions. In DataHub Cloud v2.3.0 and later, the test builder turns result tracking off by default for a test that has actions. It stays off until you change the switch. DataHub records each stored result as a relationship from the asset to the test: IsPassing for a passing asset and IsFailing for a failing asset. These relationships go into the same Elasticsearch graph index that DataHub reads to build lineage.
So one test that evaluates 1 million datasets adds about 1 million relationships to the graph index, whether the assets pass or fail. DataHub writes to these relationships in these cases:
- An asset flips between passing and failing.
- You edit the test definition. DataHub then writes the result again for every asset the test evaluates.
- An asset no longer matches the test. DataHub removes its result.
- A scheduled run of the test happens. DataHub writes a new result, with a new time stamp, for every asset the test evaluates.
Lineage queries filter by relationship type, so test results never appear in lineage. They do share the same index, though. Many broad tests across a large estate make that index larger and add constant write activity to it. Reducing the results your tests store keeps that index smaller and lowers write activity on it.
Metadata Tests might contribute to slow lineage pages, but this is not a confirmed cause.
Solution
Step 1: Find your broadest tests
- Go to Govern > Tests. You need the Manage Tests privilege to see this page.
- Look for tests whose conditions select your whole estate rather than a specific part of it. Scorecard tests that only report coverage numbers often fall into this group.
Step 2: Reduce the results each test stores
Pick one of these options for each broad test.
Turn off per-asset results for tests that only run actions. In DataHub Cloud v2.3.0 and later, every test has a Track & show results per asset switch.
- Click the test's title to open the editor.
- Go to the Add custom actions step.
- Turn off Track & show results per asset.
- Save the test.
The test keeps running and its actions still apply. It stops storing a pass or fail result on each asset, so it stops adding IsPassing and IsFailing relationships. The asset's profile no longer shows a result for that test.
Narrow the test's scope. Edit the test's conditions so it selects only the assets you need. When the test runs again, DataHub removes the stored results for assets that no longer match.
Turn the test off. In Govern > Tests, turn off the switch on the test's card. This sets the test to Inactive, and DataHub skips it during evaluation. DataHub keeps the test definition, and you can turn the switch back on at any time.
Turning off result tracking or turning off a test stops new writes. DataHub does not remove the stored results at the moment you change the setting.
Step 3: If pages are still slow
On DataHub Cloud, DataHub runs Elasticsearch for you. You can't query its indexes, run maintenance operations such as a forcemerge, or change search server settings. If lineage and entity pages are still slow after Step 2, contact DataHub Support.