Skip to content

ATLAS-5381: Handle empty/corrupted reference vertices during entity delete and purge traversal - #740

Open
sheetalshah1007 wants to merge 1 commit into
apache:masterfrom
sheetalshah1007:ATLAS-5381
Open

ATLAS-5381: Handle empty/corrupted reference vertices during entity delete and purge traversal#740
sheetalshah1007 wants to merge 1 commit into
apache:masterfrom
sheetalshah1007:ATLAS-5381

Conversation

@sheetalshah1007

@sheetalshah1007 sheetalshah1007 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes delete and purge failures when owned reference vertices are empty or corrupt — the relationship edge remains, but required properties such as __typeName and __guid are missing.

Error fixed: ATLAS-400-00-014: Type ENTITY with name null does not exist

On GET, this graph state already appears as null in relationship arrays such as relationshipAttributes.columns (ATLAS-4605). On DELETE/PURGE, however, the same invalid vertices could cause the entire operation to fail — for example, a table could not be deleted when one or more column references were empty.

This PR skips unreadable reference vertices during delete/purge traversal and logs a warning, consistent with read-path handling (ATLAS-4605) and purge resilience (ATLAS-4766).

Changes in DeleteHandlerV1

  • Add isUnreadableEntityVertex() and resolveEntityType().
  • Use them in:
    • getOwnedVertices()
    • accumulateDeletionCandidates()
    • addUpstreamProcessEntities()
    • getColumnLineageEntities()
    • deleteEdgeReference()
  • Add test testDeleteTableWithHollowOwnedColumnVertex() to verify that a table with an empty column vertex can be deleted successfully.

Problem

Graph vertices can exist as empty reference vertices: the vertex and relationship edge remain, but the entity properties are missing.

Symptoms

  • GET: Relationship arrays such as relationshipAttributes.columns may contain null entries.
  • DELETE/PURGE: ATLAS-400-00-014 can be thrown from DeleteHandlerV1.getOwnedVertices(), blocking deletion or purge expansion.

Solution

During delete/purge processing, skip vertices that cannot be read as entities and log a warning.

Valid references and the parent entity continue to be processed. When the parent is deleted, stale edges are removed through the existing deleteTypeVertex() logic.

Expected Outcome

Scenario Before After
Delete entity with empty owned reference vertex (e.g. table with corrupt column) Delete fails with ATLAS-400-00-014 Delete completes; unreadable reference vertices are skipped with a warning
Purge candidate expansion over owned references Can fail when a child reference vertex is empty or corrupt Expansion continues; corrupt references are skipped
GET entity with broken reference endpoints null entries in relationship arrays (e.g. columns) No change
Inverse entity update during edge delete Can fail if the other endpoint is an empty reference vertex Edge delete continues; inverse update is skipped

Known Limitations

  • Empty reference vertices are not repaired during traversal. Cleanup depends on parent deletion removing the stale edges.
  • GET may continue to show null in relationship arrays until the affected entity is deleted.
  • This change does not address how empty reference vertices are created, such as through interrupted purge, concurrent deletion, or external synchronization.

Testing

Automated Tests

  • DeleteHandlerV1Test.testDeleteTableWithHollowOwnedColumnVertex
  • Existing DeleteHandlerV1Test ATLAS-4766 and ATLAS-5317 purge/resilience tests pass.

Manual Verification

  • GET entity shows null in columns.
  • DELETE by GUID succeeds.
  • Purge expansion for a soft-deleted entity with an empty owned reference vertex completes without ATLAS-400-00-014.

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.

2 participants