HDDS-15100. Add an OM config to toggle Ozone snapshot rename feature#10156
Merged
smengcl merged 2 commits intoapache:masterfrom Apr 30, 2026
Merged
HDDS-15100. Add an OM config to toggle Ozone snapshot rename feature#10156smengcl merged 2 commits intoapache:masterfrom
smengcl merged 2 commits intoapache:masterfrom
Conversation
Contributor
priyeshkaratha
left a comment
There was a problem hiding this comment.
Thanks @smengcl for the patch. Changes overall LGTM. There is an issue with testcase, please check the inline comment.
jojochuang
approved these changes
Apr 29, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an OM-side configuration flag to gate the snapshot rename operation (disabled by default) to prevent use of a known-buggy feature until it’s safe, and updates tests/docs accordingly.
Changes:
- Introduce
ozone.om.snapshot.rename.allowed(default:false) and document it in defaults + snapshot docs. - Enforce the gate in
OMSnapshotRenameRequest.preExecute()by rejecting rename requests withFEATURE_NOT_ENABLED. - Update/extend unit + integration tests to explicitly enable rename where needed and to validate the blocked-by-default behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotRenameRequest.java | Enforces OM config gate for snapshot rename in preExecute. |
| hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java | Adds config key + default constant for snapshot rename gate. |
| hadoop-hdds/common/src/main/resources/ozone-default.xml | Registers the new config in default properties (default false). |
| hadoop-hdds/docs/content/feature/Snapshot.md | Documents requirement to enable rename via config. |
| hadoop-hdds/docs/content/feature/Snapshot-Configuration-Properties.md | Lists the new config in snapshot-related properties. |
| hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/snapshot/TestOMSnapshotRenameRequest.java | Sets rename allowed for existing tests; adds unit test for blocked behavior. |
| hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java | Adds integration coverage that rename is blocked when config disallows (API + CLI). |
| hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotAcl.java | Enables rename in this IT to keep rename-related coverage working under new default. |
| hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java | Enables rename in metrics IT to keep rename-related operations working under new default. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
Merged. Thanks @priyeshkaratha and @jojochuang for the swift reviews. |
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?
So far Ozone snapshot rename feature is buggy (see HDDS-11384) and we would like to have a config to disable this feature on Ozone Manager so it wouldn't be misused. AFAIK snapshot rename requires snapshot to fully transition to id-based to be truly safe to do.
For now, we should at least put it behind a config and disable that by default.
Demo
Disabled by default (tested in dev docker compose cluster):
Enabled by setting on OM, restart:
$ ozone sh bucket create s3v/buck1 $ ozone sh snapshot create s3v/buck1 ss1 $ ozone sh snapshot rename s3v/buck1 ss1 ss12 $ ozone sh snapshot list s3v/buck1 [ { "volumeName" : "s3v", "bucketName" : "buck1", "name" : "ss12", ...What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15100
How was this patch tested?