-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74559/
-----------------------------------------------------------

Review request for atlas, Madhan Neethiraj and Pinal Shah.


Bugs: ATLAS-4787
    https://issues.apache.org/jira/browse/ATLAS-4787


Repository: atlas


Description
-------

in purgeMetricsStats() method Atlas first queries all AtlasMetricsStat entries, 
filters out those who passed their TTL, and then requeryies the graph backend 
again for each entry by collectionTime just to retrieve guid which was already 
available beforehand. This is an n+1 error and completely unnecessary. This 
also causes an issue if atlas.cluster.name property was changed after some time 
(which may happen in staging environments) and then deleting by collectionTime 
of entries before the cluster.name change becomes impossible and yields an 
AtlasBaseException

org.apache.atlas.exception.AtlasBaseException: Instance __AtlasMetricsStat with 
unique attribute {metricsId=atlas_metrics_1671346802778@newclustername} does 
not exist

which then interrupts entire transaction and blocks purging of obsolete entries.


Diffs
-----

  repository/src/main/java/org/apache/atlas/services/MetricsService.java 
9ec2cd2cb 


Diff: https://reviews.apache.org/r/74559/diff/1/


Testing
-------

Tested on my cluster and run mvn clean test


Thanks,

Szymon Orzechowski

Reply via email to