-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-10719. Empty ETag for key created outside of S3 #6563
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
Conversation
ivandika3
left a comment
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.
Thank you for the fix. I left a comment.
| this.replicationConfig = b.replicationConfig; | ||
| this.isFile = b.isFile; | ||
| this.eTag = b.eTag; | ||
| this.eTag = b.eTag != null && !b.eTag.isEmpty() ? b.eTag : null; |
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.
Nit: It might be better to use StringUtils#isNotEmpty
if (StringUtils.isNotEmpty(b.eTag) {
this.eTag = b.eTag;
}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.
Or we might instead use an protobuf field existence check for eTag field on BasicOmKeyInfo#getFromProtobuf.
if (basicKeyInfo.hasETag()) {
builder.setETag(basicKeyInfo.getETag());
}
ivandika3
left a comment
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.
Thank you for the update. LGTM +1.
|
Thanks @ivandika3 for the review. |
(cherry picked from commit 96fc70e)
(cherry picked from commit 96fc70e)
What changes were proposed in this pull request?
Avoid introducing empty
ETagin response for keys created outside of S3 Gateway (e.g. via Ozone CLI).https://issues.apache.org/jira/browse/HDDS-10719
How was this patch tested?
Added assertion in existing Robot test.
CI:
https://github.com/adoroszlai/ozone/actions/runs/8758764190