ATLAS-5312: Add delete propagation support via propagateDelete flag o…#670
Draft
bhor-sanket wants to merge 2 commits into
Draft
ATLAS-5312: Add delete propagation support via propagateDelete flag o…#670bhor-sanket wants to merge 2 commits into
bhor-sanket wants to merge 2 commits into
Conversation
added 2 commits
June 12, 2026 14:41
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.
…n relationship endDefs
What changes were proposed in this pull request?
Background :
Entity relationship model relevant to this change:
Event flow — Trino CLI:
Event flow — Hive client:
Problem Statement :
Problem 1 — Orphaned entities from AGGREGATION relationships (Trino schema drop):
When Trino executes DROP SCHEMA sales CASCADE, Atlas receives ENTITY_DELETE_V2 for trino_schema. Atlas deletes the schema entity but because trino_table_schema is an AGGREGATION relationship (not COMPOSITION), the trino_table entities under that schema are NOT deleted. These tables — and their trino_column children — remain as orphaned stale metadata visible in Atlas UI. The metadata no longer reflects reality in the source system.
Problem 2 — Stale cross-system aliases (Hive database/table drop):
When Hive executes DROP DATABASE sales CASCADE, Atlas correctly cascades deletes through COMPOSITION: hive_db → hive_table → hive_column. However, the trino_table entities that are aliases of those hive_tables (linked via trino_table_hive_table ASSOCIATION relationship) remain intact. These Trino entities represent the same logical asset as the deleted Hive table — they cannot meaningfully exist without their Hive source — yet Atlas leaves them as stale metadata because no Delete mechanism exists for ASSOCIATION relationships.
Combined scenario — full orphan chain:
Deleting hive_db → hive_table is deleted (COMPOSITION) → linked trino_table is NOT deleted (ASSOCIATION) → trino_column under that trino_table is also NOT deleted. Result: stale Trino metadata at multiple levels, all pointing to non-existent Hive entities.
How the patch resolves it :
How was this patch tested?
Setup :
use-cases validation :
Delete Propagation Validation
- Verified that trino_schema entity is deleted
- Verified that all trino_table entities under that schema are deleted via propagation
- Verified that all trino_column entities under those tables are deleted (recursive cascade)
- Verified that hive_table entity is deleted
- Verified that linked trino_table (alias via trino_table_hive_table) is deleted via cross-system propagation
- Verified that trino_column entities under that trino_table are also deleted
- Verified that hive_db and all hive_table entities are deleted (reported by Hive hook)
- Verified that linked trino_schema (alias via trino_schema_hive_db) is deleted via propagation
- Verified that trino_table entities under that trino_schema are deleted via propagation
- Verified that trino_column entities under those tables are also deleted
- Verified no error when propagation encounters an already-deleted target vertex
Regression Testing