ArafatKhan2198 opened a new pull request, #6273: URL: https://github.com/apache/ozone/pull/6273
## What changes were proposed in this pull request? A bug was identified where updating an existing key with new metadata does not lead to the expected update of the metadata; instead, the system retains the old metadata. These keys were created using the S3 CLI. To simulate this problem please take a look at the JIRA description. ### Root Cause :- When we create an object with the same key name as one already in the database, the request is forwarded to the OM side of the code, specifically to the `OmKeyRequest` class, which contains a method called `prepareFileInfo()`. This method persists the data to the `openKeyTable`. Initially, it checks if a key with the same name exists. If it does, it proceeds to update it with new `data size`,` modification time`, `updateID`, and `replicationConfig`. However, it fails to update the `metadata` of the overridden file. Consequently, the old metadata stored earlier is retained, which is the root cause of the problem and requires fixing. ### Changes made :- 1. Extracting the new metadata from the KeyArgs object. 2. Comparing the new metadata with the existing metadata in the OmKeyInfo object. 3. Updating the OmKeyInfo object with any new or modified metadata entries. 4. Ensuring that metadata entries not mentioned in the overwrite operation are retained as is. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-10324 ## How was this patch tested? Tested it out Manually. Currently writing the UT's for it. -- 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]
