smengcl opened a new pull request, #11438:
URL: https://github.com/apache/ozone/pull/11438

   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 not `continue`, 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:
   
   * The destination row is replaced in the key table and its blocks are never 
added to the deleted table, so they are leaked.
   * The response is `PARTIAL_RENAME` and lists the same pair in 
`unRenamedKeys`, so the client is told that the rename did not happen.
   * If the source key does not exist either, the pair is listed twice in 
`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 with `KEY_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 is `PARTIAL_RENAME`, that each pair is 
listed exactly once in `unRenamedKeys`, and that both key table rows are 
unchanged. The test fails without the fix.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to