Skip to content

fix(asset-export-basic): preload domain cache to fix truncated hierarchy paths (CSA-444)#2561

Open
bladata1990 wants to merge 3 commits into
mainfrom
fix/csa-444-preload-domain-cache
Open

fix(asset-export-basic): preload domain cache to fix truncated hierarchy paths (CSA-444)#2561
bladata1990 wants to merge 3 commits into
mainfrom
fix/csa-444-preload-domain-cache

Conversation

@bladata1990

@bladata1990 bladata1990 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

What & why

JPMC's CSA Asset Export produced truncated domain hierarchy paths for mid-tier domains — e.g. a Data Product under Risk Management and Compliance > Wholesale Credit Risk exported as Wholesale Credit Risk@<product> instead of Risk Management and Compliance@Wholesale Credit Risk@<product>. The tenant data was correct; the bug was in the exporter.

Linear: CSA-444

Root cause

MeshExporter.export() never called ctx.dataDomainCache.preload(). Without it, domains were lazy-loaded one-at-a-time (getByGuid → lookupById) in GUID order, not parent-before-child order. When a mid-tier domain was looked up before its parent was cached, getIdentityForAsset resolved the parent identity via getIdentity(parentGuid, bypassReadLock=true) — which is non-recursive and does not lookup-on-miss — so it returned blank and the domain was cached with a 1-level-short identity. Every product/sub-domain referencing it then inherited the truncated path.

Only DataDomainCache.refreshCache() loads domains in level-order (roots first, then children sorted by parent QN), and it runs only inside preload(). Sibling packages already call it (asset-import/AbstractBaseImporter.kt, cube-assets-builder/Importer.kt); asset-export-basic was the only mesh-touching package missing it.

The fix

One line in MeshExporter.export(), before the export loop:

ctx.dataDomainCache.preload()

This loads the domain cache up-front in parents-before-children order. preload() is @Synchronized and idempotent; the cost is one bulk paged scan instead of N individual size=1 lookups (net cheaper).

Tests

Added ExportDomainHierarchyTest — builds a 3-level domain hierarchy (grandparent → parent → child) with a data product under the deepest child and asserts the export resolves full level-order identities (not truncated).

Verification on a live tenant

Built a snapshot image (ghcr.io/atlanhq/csa-asset-export-basic:7.2.4-SNAPSHOT), deployed to apps-typedef.atlan.com, created a 3-level fixture (D3 → SD1 → CSA444-Leaf with CSA444-Product), and ran the export.

Test workflow run: https://apps-typedef.atlan.com/api/orchestration/workflows/default/csa-asset-export-basic-csa444-mctgz

Result in products-export.csv:

Row Column Value
CSA444-Product (DataProduct) dataDomain D3@SD1@CSA444-Leaf ✅ full 3-level
CSA444-Leaf (DataDomain) parentDomain D3@SD1
SD1 (DataDomain) parentDomain D3

Mid-tier domains now resolve to their full root-to-leaf identity. Before the fix, CSA444-Product would have shown SD1@CSA444-Leaf / CSA444-Leaf.

Follow-up

atlanhq/marketplace-packages needs its csa-asset-export-basic image bumped to a released version once this lands and a tagged build is published (tracked under CSA-444).

…chy paths (CSA-444)

MeshExporter.export() lazy-loaded domains in GUID order, so mid-tier
domains looked up before their parent were cached with truncated
identities, producing 1-level-short hierarchy paths in the export.
Preload the domain cache up-front (level-order, parents-before-children),
matching asset-import and cube-assets-builder.

Adds ExportDomainHierarchyTest covering a 3-level domain hierarchy.

merge.yml: temporarily build snapshot images on push to this branch
(to be reverted before PR).
…snapshot)

Prevents an unrelated package build failure from cancelling the
asset-export-basic snapshot image build. Temporary; revert before PR.
Reverts the push-trigger branch entry and fail-fast:false added for
snapshot image testing. merge.yml now matches main.
@bladata1990 bladata1990 requested a review from cmgrote as a code owner June 11, 2026 12:07
@linear

linear Bot commented Jun 11, 2026

Copy link
Copy Markdown

CSA-444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant