Repository navigation
Conversation
…ll reports the pair as not renamed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrow fix and regression assertions address the reported defect with no identified blocking issues; tests were not executed.
0 open findings
What changed in this PR
Fixes OM batch rename handling so an existing destination key is preserved and each rejected pair is reported only once.
Changes:
- Skip rename processing when the destination already exists.
- Add regression coverage for unchanged keys and accurate failure reporting.
| File | Description |
|---|---|
| hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeysRenameRequest.java | Tests destination preservation and single reporting of rejected pairs. |
| hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeysRenameRequest.java | Adds the missing continue for existing destinations. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Generated-by: Claude Code (Opus 5.5)
What changes were proposed in this pull request?
In
OMKeysRenameRequest#validateAndUpdateCache, the "Check if toKey exists" block marks the pair as not renamed but does notcontinue, unlike the other checks in the same loop. A batch rename onto an existing key therefore still renames the source key over the destination key:PARTIAL_RENAMEand lists the same pair inunRenamedKeys, so the client is told that the rename did not happen.unRenamedKeys.This PR adds the missing
continue, so the pair is skipped and both keys are left unchanged. This matches the single key rename (OMKeyRenameRequest), which rejects the same case withKEY_ALREADY_EXISTS.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16757
How was this patch tested?
Added
TestOMKeysRenameRequest#testKeysRenameRequestToExistingKey. It batch renames one existing key onto another, together with a pair whose source key is missing, and asserts that the status isPARTIAL_RENAME, that each pair is listed exactly once inunRenamedKeys, and that both key table rows are unchanged. The test fails without the fix.🤖 Generated with Claude Code