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/10/19 08:52:06 UTC

[atlas] branch branch-2.0 updated: ATLAS-4666 : Intermittently, the audits for creation of hive_db registered are different than expected

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 281869923 ATLAS-4666 : Intermittently, the audits for creation of hive_db registered are different than expected
281869923 is described below

commit 28186992318e996341cf516daefa652df1abd1cb
Author: Mandar Ambawane <ma...@freestoneinfotech.com>
AuthorDate: Tue Sep 6 10:38:44 2022 +0530

    ATLAS-4666 : Intermittently, the audits for creation of hive_db registered are different than expected
    
    Signed-off-by: Pinal Shah <pi...@freestoneinfotech.com>
    (cherry picked from commit a5eb426263632034513ba7013913b57875ec7c5f)
---
 .../org/apache/atlas/repository/audit/EntityAuditListenerV2.java | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListenerV2.java b/repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListenerV2.java
index d48c91709..9b011ab06 100644
--- a/repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListenerV2.java
+++ b/repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListenerV2.java
@@ -128,6 +128,8 @@ public class EntityAuditListenerV2 implements EntityChangeListenerV2 {
                 action = CUSTOM_ATTRIBUTE_UPDATE;
             } else if (reqContext.checkIfEntityIsForBusinessAttributeUpdate(entity.getGuid())) {
                 action = BUSINESS_ATTRIBUTE_UPDATE;
+            } else if (isShellEntity(entity)) {
+                action = ENTITY_CREATE;
             } else {
                 action = ENTITY_UPDATE;
             }
@@ -651,4 +653,11 @@ public class EntityAuditListenerV2 implements EntityChangeListenerV2 {
         return ret;
 
     }
+
+    private boolean isShellEntity(AtlasEntity entity) {
+        if (entity.getIsIncomplete() != null && entity.getCreateTime() != null && entity.getUpdateTime() != null) {
+            return entity.getIsIncomplete() && entity.getCreateTime().getTime() == entity.getUpdateTime().getTime();
+        }
+        return false;
+    }
 }