Skip to content

HDDS-15428. Remove purged snapshot YAMLs in one run#10387

Draft
smengcl wants to merge 2 commits into
apache:masterfrom
smengcl:HDDS-15428-yaml
Draft

HDDS-15428. Remove purged snapshot YAMLs in one run#10387
smengcl wants to merge 2 commits into
apache:masterfrom
smengcl:HDDS-15428-yaml

Conversation

@smengcl
Copy link
Copy Markdown
Contributor

@smengcl smengcl commented May 30, 2026

Generated-by: Codex (GPT-5.4)

What changes were proposed in this pull request?

This is an optimization. OM orphan snapshot cleanup could start from an older queued snapshot before a newer descendant. In linear snapshot chains, that caused unnecessary early ancestor checks. The newest descendant could still make cleanup complete in the same drain, but older snapshots were revisited later in that drain after they became eligible.

  • order the initial orphan-cleanup list by snapshot creation time descending when snapshot metadata is available
  • keep the existing queue-based ancestor cascade for newly eligible snapshots discovered during the drain
  • add debug/info logging

Before this change

  • queued seeds: S2, S3. snapshot created in the same bucket in order of S1 to S3
  • OM could check S2 first, find nothing removable yet
  • OM then checked S3, which made S2 eligible
  • S2 had to be revisited later in the same drain, or left queued for a later run depending on state

After the change

  • initial seeds are ordered newest-first: S3, S2
  • OM checks S3 first and immediately cascades to S2 and then older ancestors as they become eligible
  • in a fully purged multiple snapshot chain, all YAMLs are removed in a single drain and each snapshot is checked once

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15428

How was this patch tested?

  • Added regression coverage
  • Added six-snapshot chain test case to verify the optimization works

@smengcl smengcl added performance snapshot https://issues.apache.org/jira/browse/HDDS-6517 AI-gen labels May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-gen performance snapshot https://issues.apache.org/jira/browse/HDDS-6517

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant