Commit 0a6d098c by Saqeeb Shaikh Committed by Sarath Subramanian

ATLAS-3360: Duplicate audits in atlas when HMS and hive hook is enabled.

parent 5ee49fde
...@@ -839,7 +839,13 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { ...@@ -839,7 +839,13 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore {
} }
if (entitiesToSkipUpdate != null) { if (entitiesToSkipUpdate != null) {
// remove entitiesToSkipUpdate from EntityMutationContext
context.getUpdatedEntities().removeAll(entitiesToSkipUpdate); context.getUpdatedEntities().removeAll(entitiesToSkipUpdate);
// remove entitiesToSkipUpdate from RequestContext
for (AtlasEntity entity : entitiesToSkipUpdate) {
RequestContext.get().removeEntityUpdate(entity);
}
} }
// Check if authorized to update entities // Check if authorized to update entities
......
...@@ -189,6 +189,12 @@ public class RequestContext { ...@@ -189,6 +189,12 @@ public class RequestContext {
} }
} }
public void removeEntityUpdate(AtlasEntity entity) {
if (entity != null && entity.getGuid() != null) {
updatedEntities.remove(entity.getGuid());
}
}
public void recordEntityDelete(AtlasEntityHeader entity) { public void recordEntityDelete(AtlasEntityHeader entity) {
if (entity != null && entity.getGuid() != null) { if (entity != null && entity.getGuid() != null) {
deletedEntities.put(entity.getGuid(), entity); deletedEntities.put(entity.getGuid(), entity);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment