HDDS-13780. Skeleton of background snapshot defrag service#9133
HDDS-13780. Skeleton of background snapshot defrag service#9133smengcl merged 34 commits intoapache:masterfrom
Conversation
(cherry picked from commit f81e5b7)
(cherry picked from commit e15a62d)
…efrag.limit.per.task`, `ozone.snapshot.defrag.service.interval`. (cherry picked from commit c04d67a)
(cherry picked from commit ac58394)
(cherry picked from commit ab9d67e)
Conflicts: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotLocalDataYaml.java
… be handled in upper logic
There was a problem hiding this comment.
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.
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Show resolved
Hide resolved
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConfigKeys.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBSstFileWriter.java
Show resolved
Hide resolved
swamirishi
left a comment
There was a problem hiding this comment.
@smengcl thank you for working on the patch have a few review comments
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBSstFileWriter.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Outdated
Show resolved
Hide resolved
Thanks @swamirishi for the review. I have addressed all comments. Pls take another look. |
swamirishi
left a comment
There was a problem hiding this comment.
LGTM @smengcl thank you for addressing the review comments
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java
Outdated
Show resolved
Hide resolved
…rvice Conflicts: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotLocalDataYaml.java
|
Thanks @swamirishi , @TaiJuWu for reviewing this. |
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?