You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Siyao Meng (Jira)" <ji...@apache.org> on 2026/10/22 19:15:00 UTC

[jira] [Commented] (HDDS-16753) NumSnapshotDeleted is not decremented when a snapshot is purged

    [ https://issues.apache.org/jira/browse/HDDS-16753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18130505#comment-18130505 ] 

Siyao Meng commented on HDDS-16753:
-----------------------------------

[Jira cleanup 2026-10-22] Resolving as Fixed. Snapshot purge now decrements the deleted-snapshot gauge.

Evidence:
* https://github.com/apache/ozone/pull/11568
* https://github.com/apache/ozone/commit/a826a8e6306fb7b0c2af2a07958ddcb76e42c47c
* https://github.com/apache/ozone/blob/bf3829e6c8ac69ae17585585703f91426dcdf6b3/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotPurgeRequest.java#L145

Feel free to reopen if further work is needed.

> NumSnapshotDeleted is not decremented when a snapshot is purged
> ---------------------------------------------------------------
>
>                 Key: HDDS-16753
>                 URL: https://issues.apache.org/jira/browse/HDDS-16753
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: Ozone Manager
>            Reporter: Chi-Hsuan Huang
>            Assignee: Chi-Hsuan Huang
>            Priority: Major
>              Labels: pull-request-available
>
> Follow-up to HDDS-16719.
> {{OMMetrics.numSnapshotDeleted}} is incremented in {{OMSnapshotDeleteRequest}} when a snapshot is marked {{SNAPSHOT_DELETED}}, but nothing decrements it when {{SnapshotDeletingService}} purges that snapshot:
> * {{OMSnapshotPurgeRequest}} removes the entry from {{snapshotInfoTable}} and only calls {{omSnapshotIntMetrics.incNumSnapshotPurges()}}.
> * {{decNumSnapshotDeleted()}} has had no callers since it was added in HDDS-7506, and HDDS-16726 removes it as unused.
> As a result, {{NumSnapshotDeleted}} keeps growing on a long-running OM and reflects "snapshots deleted since startup" rather than "snapshots waiting to be purged". The value is only corrected when {{updateActiveSnapshotMetrics()}} recounts the table on OM start or checkpoint reload. The bundled OM Snapshot dashboard plots this raw value, so the drift is visible there.
> Proposed changes:
> * Re-add {{decNumSnapshotDeleted()}} using {{decr()}} (the field is a gauge after HDDS-16719) and call it in {{OMSnapshotPurgeRequest}} for each snapshot actually purged, skipping the case where the snapshot is already gone from the table.
> * Assert {{NumSnapshotDeleted}} in {{TestOMSnapshotPurgeRequestAndResponse}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org