Repository navigation
fix(lineage-builder): save previous files under the package's own prefix - #2928
Open
kabhishek1001 wants to merge 2 commits into
Open
kabhishek1001 wants to merge 2 commits into
kabhishek1001 wants to merge 2 commits into
Conversation
…e run Runs Asset Import on Full Replacement with three tables, then the Lineage Builder on the same connection, then Asset Import again with one table dropped. Checks that the dropped table is archived, the lineage is left active, and each package saves its previous files under its own prefix.
The Lineage Builder hands its assets and lineage files to Asset Import's importer without setting assetsPreviousFilePrefix, so both copies were saved under csa-asset-import/<connection>/. A Full Replacement Asset Import on the same connection then compared its file against the lineage file instead of its own previous file, archived the lineage, and removed none of the assets that had dropped out of its file. Pass csa-lineage-builder as the prefix in both calls, the same way the Relational Assets Builder and Cube Assets Builder use their own.
kabhishek1001
marked this pull request as ready for review
November 9, 2026 23:41
kabhishek1001
requested review from
ashish-atlan,
bladata1990,
cmgrote,
jtgatlan and
suseriAtlan
as code owners
November 9, 2026 23:41
bladata1990
approved these changes
Nov 10, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Failure
Since #2024, the Lineage Builder loads its assets file and its lineage file by calling Asset Import's
Importer.import. It builds bothAssetImportCfgs withoutassetsPreviousFilePrefix, soImporterfalls back tocsa-asset-importand both copies are saved undercsa-asset-import/<connection>/, the same folder Asset Import's own runs use.When an Asset Import workflow on Full Replacement (
assets_delta_semantic: full) and a Lineage Builder load into the same connection:csa-asset-import/<connection>/.CSA_LB_assets.csvand thenCSA_LB_lineage.csvinto the same folder.I reproduced this on an internal tenant with Asset Import 2.7.0 and Lineage Builder 2.4.70 (both on 7.3.1). A second Full Replacement import straight after, with no Lineage Builder run in between, archived the dropped asset as expected. So Full Replacement works when the newest copy is its own.
Fix
LoaderpassesassetsPreviousFilePrefix = "csa-lineage-builder"in bothAssetImportCfgs, the same way the Relational Assets Builder (csa-relational-assets-builder) and Cube Assets Builder (csa-cube-assets-builder) use their own prefix.The Lineage Builder never sets a delta mode, so it always runs Incremental and only writes to this folder. It never reads from it. The connection cache update doesn't use the prefix.
Test
samples/packages/lineage-builder/src/test/kotlin/SeparatePreviousFilesTest.ktis a package test against a tenant, in the same style as the other Lineage Builder tests. On one new connection it runs:It checks that T3 is archived, T1 and T2 are still active, the lineage process is still active, and that Asset Import and the Lineage Builder each have their two saved files under their own prefix. It names the prefix as a string rather than using the new constant, so it also compiles without the fix. The test is in its own commit (66d78d8), before the fix (a010ad1).
What ran
pr-build(assemble, shadowJar, spotlessCheck) andpr-test(testClasses test) passed.ATLAN-JAVA-500-000 Server responded with an error -- 504. The two existing Lineage Builder tests that use the tenant,PartialAssetsTestandCustomConnectionTest, failed setup with the same 504, as they did in last night's nightly run onmain.kotlin-dsl5.2.0 plugin thatbuildSrcneeds.build-artifactsof run 42706040361 (this branch, a010ad1).main(run 42560186102, b44068a).Loader.classis the only Lineage Builder class that differs between the two builds.gradle/libs.versions.toml, on Java 17.droppedTableArchivedkeptTablesStillActive[T1, T2], actual[T1, T2, T3]lineageStillActiveeachPackageSavesToItsOwnPrefixcsa-asset-import, actual 4Without the fix, the Lineage Builder uploaded
CSA_LB_assets.csvandCSA_LB_lineage.csvtocsa-asset-import/<connection>/, and the second import loggedprevious file: <the CSA_LB_lineage.csv copy>beforeDeleting (SOFT) 1 assets. With the fix, both went tocsa-lineage-builder/<connection>/, and the second import's previous file was the first import's own copy. Both runs purged their test connection afterwards. The package test will still need a green run in the Test workflow once the CI tenant stops returning 504s.Rollout note
After upgrading, the first Full Replacement import on a connection will still find the last Lineage Builder copy in
csa-asset-import/<connection>/and compare against it. Removals start from the run after that, unless those leftover copies are deleted first.