Skip to content

Conversation

smengcl
Copy link
Contributor

@smengcl smengcl commented Oct 9, 2025

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.

@smengcl smengcl requested review from Copilot and swamirishi October 9, 2025 22:05
@smengcl smengcl added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Oct 9, 2025
Copy link
Contributor

@Copilot 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 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
File Description
SnapshotDefragService.java New background service implementing snapshot defragmentation with full and incremental processing modes
OmSnapshotLocalDataYaml.java Fixed null handling for previous snapshot ID in YAML data construction
KeyManagerImpl.java Added service startup/shutdown and configuration integration for snapshot defragmentation
KeyManager.java Added interface method for accessing snapshot defrag service
OMConfigKeys.java Added configuration keys for defrag service interval and limits
RocksDatabase.java Made checkpoint creation and get methods public for external access
RDBSstFileWriter.java Made class and constructor public, added delete method for SST file operations
ozone-default.xml Added configuration properties for snapshot defragmentation service
OzoneConsts.java Added constant for defragmented checkpoint directory
OzoneConfigKeys.java Added timeout configuration for snapshot defragmentation service

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

@smengcl smengcl requested a review from swamirishi October 10, 2025 22:44
Copy link
Contributor

@swamirishi swamirishi left a comment

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
Contributor Author

smengcl commented Oct 13, 2025

@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.

Copy link
Contributor

@swamirishi swamirishi left a comment

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

}

private UncheckedAutoCloseableSupplier<OmSnapshot> getSnapshot(String snapshotTableKey, boolean skipActiveCheck)
UncheckedAutoCloseableSupplier<OmSnapshot> getSnapshot(String snapshotTableKey, boolean skipActiveCheck)
Copy link
Contributor

Choose a reason for hiding this comment

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

@smengcl No need for this change anymore

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