You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by pi...@apache.org on 2022/05/05 12:15:19 UTC

[atlas] branch branch-2.0 updated: ATLAS-4572: Improved Soft Delete behavior for relationships edges

This is an automated email from the ASF dual-hosted git repository.

pinal pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 2b78b4f50 ATLAS-4572: Improved Soft Delete behavior for relationships edges
2b78b4f50 is described below

commit 2b78b4f506f30dba90027e88e0c2ce9240733fe7
Author: Mandar Ambawane <ma...@freestoneinfotech.com>
AuthorDate: Wed Apr 20 23:46:46 2022 +0530

    ATLAS-4572: Improved Soft Delete behavior for relationships edges
    
    Signed-off-by: Pinal Shah <pi...@freestoneinfotech.com>
    (cherry picked from commit 719dcb2e7467282155d453bc12a5a29fdadbc138)
---
 .../org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
index f118ae69a..6964211e9 100644
--- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
+++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
@@ -353,6 +353,10 @@ public abstract class DeleteHandlerV1 {
             // for relationship edges, inverse vertex's relationship attribute doesn't need to be updated.
             // only delete the reference relationship edge
             if (GraphHelper.isRelationshipEdge(edge)) {
+                //If the edge is already deleted then skip the further delete operations
+                if (this instanceof SoftDeleteHandlerV1 && GraphHelper.getEdgeStatus(edge) == AtlasRelationship.Status.DELETED) {
+                    return !softDelete || forceDelete;
+                }
                 deleteEdge(edge, isInternalType);
 
                 AtlasVertex referencedVertex = entityRetriever.getReferencedEntityVertex(edge, relationshipDirection, entityVertex);