-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-10324. Metadata are not updated when keys are overwritten. #6273
Conversation
@ArafatKhan2198 Will the bug also causes ETag field to not be updated when overwriting an object with another object with different content? |
@ivandika3 If you modify the contents of the file, the ETag will change accordingly. I have tested this scenario, and when uploading a file with the same key name but different content, the |
@ChenSammi @sumitagrawl Could you please take a look! |
https://github.com/ArafatKhan2198/ozone/actions/runs/8045754649/job/21971634453 |
...p-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
Outdated
Show resolved
Hide resolved
...p-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ArafatKhan2198 for the patch.
...one-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyCreateRequest.java
Outdated
Show resolved
Hide resolved
...p-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
Outdated
Show resolved
Hide resolved
...one-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyCreateRequest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last patch looks good. Thanks @ArafatKhan2198 .
Thanks @ArafatKhan2198 for the patch, @ChenSammi for the review. |
…tten. apache#6273 (cherry picked from commit aa68aec) Change-Id: I05e802a9580565cbd10e9c1f59c9228b4527b44e
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 calledprepareFileInfo()
. This method persists the data to theopenKeyTable
. Initially, it checks if a key with the same name exists. If it does, it proceeds to update it with newdata size
,modification time
,updateID
, andreplicationConfig
. However, it fails to update themetadata
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 :-
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 & Tested it out with UT's for the below two scenarios :-