You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Szymon Orzechowski (Jira)" <ji...@apache.org> on 2023/08/22 14:53:00 UTC
[jira] [Commented] (ATLAS-4787) MetricsService.purgeMetricsStats() should remove stat by guid
[ https://issues.apache.org/jira/browse/ATLAS-4787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17757519#comment-17757519 ]
Szymon Orzechowski commented on ATLAS-4787:
-------------------------------------------
Please assign this issue to me :)
> MetricsService.purgeMetricsStats() should remove stat by guid
> -------------------------------------------------------------
>
> Key: ATLAS-4787
> URL: https://issues.apache.org/jira/browse/ATLAS-4787
> Project: Atlas
> Issue Type: Improvement
> Components: atlas-core
> Affects Versions: 3.0.0
> Reporter: Szymon Orzechowski
> Priority: Major
>
> As of now, current code of MetricsService.purgeMetricsStats() does:
> # Retrieve all metric stats (getAllMetricsStats(true))
> # filters out metrics to delete
> # iteraters over each entry (deleteMetricsStatByCollectionTime)
> ## queries metric stat by timestamp
> ## deletes metric stat by guid
> This however is an n+1 error because at step 1. we already have the necessary guids. At step 3. Atlas could either do a batch delete or delete by guid right off the bat.
>
> Deleting by collectionTime also causes an issue if atlas.cluster.name was changed after some time, because it would try to look for obsolete metric stat with new cluster name, which results with
> {code:java}
> org.apache.atlas.exception.AtlasBaseException: Instance __AtlasMetricsStat with unique attribute {metricsId=atlas_metrics_1671346802778@newclustername} does not exist
> {code}
> and rollbacks the entire transaction.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)