Skip to content

HDDS-13554. Clean up snapshot local YAML file on Snapshot purge.#8939

Merged
jojochuang merged 2 commits into
apache:masterfrom
SaketaChalamchala:HDDS-13554
Aug 19, 2025
Merged

HDDS-13554. Clean up snapshot local YAML file on Snapshot purge.#8939
jojochuang merged 2 commits into
apache:masterfrom
SaketaChalamchala:HDDS-13554

Conversation

@SaketaChalamchala
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

HDDS-13253 Creates a local data file (YAML) on snapshot create or every snapshot to track snapshot compaction metadata.
This PR ensures that the local data file is removed along with the snapshot checkpoint on snapshot purge.

What is the link to the Apache JIRA

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

How was this patch tested?

Updated existing Unit test.

@jojochuang jojochuang added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Aug 13, 2025
Copy link
Copy Markdown
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SaketaChalamchala can you rebase? I believe the PR contains unrelated parts.

@SaketaChalamchala SaketaChalamchala marked this pull request as ready for review August 18, 2025 17:40
Copilot AI review requested due to automatic review settings August 18, 2025 17:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures cleanup of snapshot local YAML files during snapshot purge operations. The change adds deletion of YAML metadata files that track snapshot compaction information, which were previously left behind when snapshots were purged.

Key changes:

  • Enhanced snapshot purge to delete associated YAML metadata files
  • Updated tests to verify YAML file cleanup during purge operations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
OMSnapshotPurgeResponse.java Added deletion of snapshot local YAML metadata files during checkpoint cleanup
TestOMSnapshotPurgeRequestAndResponse.java Enhanced test coverage to verify YAML file existence before purge and cleanup after purge

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

OmSnapshotManager.getSnapshotLocalPropertyYamlPath(omMetadataManager, snapshotInfo));
try {
FileUtils.deleteDirectory(snapshotDirPath.toFile());
Files.deleteIfExists(snapshotLocalDataPath);
Copy link

Copilot AI Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The YAML file deletion should be included in the same try-catch block as the directory deletion to ensure consistent error handling and logging for both operations.

Copilot uses AI. Check for mistakes.
@jojochuang jojochuang merged commit 7af7593 into apache:master Aug 19, 2025
52 of 53 checks passed
@jojochuang
Copy link
Copy Markdown
Contributor

Thanks @SaketaChalamchala

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants