Skip to content

HDDS-13780. Skeleton of background snapshot defrag service - #9133

Merged
smengcl merged 34 commits into
apache:masterfrom
smengcl:HDDS-13780-skeleton-defrag-service
Oct 14, 2025
Merged

HDDS-13780. Skeleton of background snapshot defrag service#9133
smengcl merged 34 commits into
apache:masterfrom
smengcl:HDDS-13780-skeleton-defrag-service

Conversation

@smengcl

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This is #9117 but shrunk down to just the skeleton of the service, without actual defrag operations.

What is the link to the Apache JIRA

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

How was this patch tested?

  • Test case was running fine before the last commit that removes core defrag logic.

@smengclsmengcl added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Oct 9, 2025

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 implements a skeleton for a background snapshot defragmentation service in Ozone Manager. The service is designed to process snapshots in the active snapshot chain and defragment them by creating compacted RocksDB instances.

  • Adds the main SnapshotDefragService class with background task scheduling and snapshot processing logic
  • Integrates the service into KeyManager with configuration and lifecycle management
  • Updates related classes to support the defragmentation infrastructure

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
SnapshotDefragService.javaNew background service implementing snapshot defragmentation with full and incremental processing modes
OmSnapshotLocalDataYaml.javaFixed null handling for previous snapshot ID in YAML data construction
KeyManagerImpl.javaAdded service startup/shutdown and configuration integration for snapshot defragmentation
KeyManager.javaAdded interface method for accessing snapshot defrag service
OMConfigKeys.javaAdded configuration keys for defrag service interval and limits
RocksDatabase.javaMade checkpoint creation and get methods public for external access
RDBSstFileWriter.javaMade class and constructor public, added delete method for SST file operations
ozone-default.xmlAdded configuration properties for snapshot defragmentation service
OzoneConsts.javaAdded constant for defragmented checkpoint directory
OzoneConfigKeys.javaAdded timeout configuration for snapshot defragmentation service

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

@swamirishiswamirishi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@smengcl thank you for working on the patch have a few review comments

@smengcl

Copy link
Copy Markdown
ContributorAuthor

@smengcl thank you for working on the patch have a few review comments

Thanks @swamirishi for the review. I have addressed all comments. Pls take another look.

@swamirishiswamirishi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM @smengcl thank you for addressing the review comments

…rvice
Conflicts:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotLocalDataYaml.java
@smengcl
smengcl merged commit 96ce0b6 into apache:masterOct 14, 2025
43 checks passed
@smengcl
smengcl deleted the HDDS-13780-skeleton-defrag-service branch October 14, 2025 20:06
@smengcl

Copy link
Copy Markdown
ContributorAuthor

Thanks @swamirishi , @TaiJuWu for reviewing this.

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

Labels

snapshothttps://issues.apache.org/jira/browse/HDDS-6517

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@smengcl@TaiJuWu@swamirishi