Sheetal Shah created ATLAS-5381:
-----------------------------------

             Summary: Entity delete and purge fail when traversing empty owned 
reference vertices
                 Key: ATLAS-5381
                 URL: https://issues.apache.org/jira/browse/ATLAS-5381
             Project: Atlas
          Issue Type: Improvement
          Components:  atlas-core
            Reporter: Sheetal Shah


h2. Summary

Entity delete and purge can fail when Atlas traverses owned references (e.g. 
{{columns}} on  {{{}hive_table{}}}) and hits empty reference vertices: the 
vertex and relationship edge still exist, but the vertex has no properties 
({{{}__typeName{}}}, {{{}__guid{}}}, etc.).

On read, Atlas tolerates this (ATLAS-4605) and returns {{null}} in arrays like 
{{{}relationshipAttributes.columns{}}}. On delete/purge, {{getOwnedVertices()}} 
throws and the parent operation fails.
h2. Error
 
{"errorCode":"ATLAS-400-00-014","errorMessage":"Type ENTITY with name null does 
not exist"}
org.apache.atlas.exception.AtlasBaseException: Type ENTITY with name null does 
not exist
at 
org.apache.atlas.repository.store.graph.v1.DeleteHandlerV1.getOwnedVertices(DeleteHandlerV1.java:218)
at 
org.apache.atlas.repository.store.graph.v1.DeleteHandlerV1.deleteEntities(DeleteHandlerV1.java:123)
at 
org.apache.atlas.repository.store.graph.v2.AtlasEntityStoreV2.purgeVertices(AtlasEntityStoreV2.java:1385)
at 
org.apache.atlas.repository.store.graph.v2.AtlasEntityStoreV2.purgeByIds(AtlasEntityStoreV2.java:586)
 Root cause
h3. Graph state

Some owned reference vertices are in an inconsistent state:
 * Relationship edge from parent → child still exists
 * Target vertex exists in graph storage
 * Target vertex has empty or missing properties ({{{}__typeName{}}} is null)

This can occur due to:
 * Partial hard purge / incomplete composite cleanup
 * Concurrent purge and delete on related entities
 * Incomplete metadata sync (for example, column dropped in source system but 
Atlas graph left with dangling edges)
 * Failed or interrupted delete/purge leaving vertex shells behind

h3. Read vs delete behavior mismatch

Read path ({{{}EntityGraphRetriever{}}}) — handled since ATLAS-4605:
 * When a reference vertex has no property keys, Atlas logs a warning and 
returns {{null}} in the relationship array
 * GET succeeds but shows {{null}} entries in arrays like {{columns}}

Delete/purge traversal path ({{{}DeleteHandlerV1.getOwnedVertices{}}}) — not 
handled:
 * Traverses owned reference attributes via relationship edges
 * Calls {{toAtlasEntityHeader()}} on each referenced vertex
 * If {{typeName}} is null, throws {{TYPE_NAME_INVALID}} 
({{{}ATLAS-400-00-014{}}})
 * Parent entity delete/purge fails entirely



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to