HDDS-15201. Record lastDefragTime when snapshot defrag is successfully run#10210
Open
smengcl wants to merge 2 commits intoapache:masterfrom
Open
HDDS-15201. Record lastDefragTime when snapshot defrag is successfully run#10210smengcl wants to merge 2 commits intoapache:masterfrom
smengcl wants to merge 2 commits intoapache:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the lastDefragTime field in OM snapshot local YAML metadata meaningful by recording the time (epoch millis) of the last successful snapshot-defrag version commit, and updates parsing/tests/docs accordingly.
Changes:
- Record
lastDefragTimewhen a new snapshot version is added during snapshot defrag. - Make YAML loading default
lastDefragTimeto0when absent, and add unit coverage for legacy YAML. - Update snapshot defragmentation documentation to clarify
lastDefragTimesemantics.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotLocalDataYaml.java | Makes tests deterministic for lastDefragTime and adds legacy YAML coverage (missing field defaults to 0). |
| hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotLocalDataManager.java | Adds assertion that lastDefragTime is set during snapshot version addition flow. |
| hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotLocalDataManager.java | Records lastDefragTime when adding a snapshot version (defrag output). |
| hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotLocalDataYaml.java | Defaults missing lastDefragTime to 0 and simplifies numeric handling. |
| hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotLocalData.java | Changes setter signature to primitive long for lastDefragTime. |
| hadoop-hdds/docs/content/feature/SnapshotDefragmentation.md | Updates docs to describe lastDefragTime as the wall-clock time of committing a new defragged version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Right now we have lastDefragTime field in each snapshot yaml but not used. Make it actually useful by informing users/debuggers of last successful defrag time of that snapshot DB.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15201
How was this patch tested?