HDDS-15618. Fix ListObjects to include single whitespace-only S3 object keys#10589
Conversation
priyeshkaratha
left a comment
There was a problem hiding this comment.
Thanks @Gargi-jais11 for the patch. Changes LGTM
ivandika3
left a comment
There was a problem hiding this comment.
Thanks @Gargi-jais11 , left one comment.
|
Thanks @Gargi-jais11 for working on this. As far as I know, HDFS doesn't support filenames with spaces. I'm concerning about how this change impact that. Have you looked into it? |
I have tested creating hdfs filenames with spaces and it does support. Evidence: and even ozone supports creating key with space : The S3 issue was not “Ozone/HDFS rejects space keys.” It was a create vs list mismatch caused by a bug in how OM builds the internal metadata key. OM treated " " as “no key segment” and stored it at /vol1/buck1 instead of /vol1/buck1/. |
ivandika3
left a comment
There was a problem hiding this comment.
Thanks @Gargi-jais11 for the update. LGTM +1.
|
Thanks @Gargi-jais11 for the patch and @chungen0126 for the review. |
What changes were proposed in this pull request?
s3-tests
test_bucket_create_special_key_namesfails because a key named**' '**is created but not returned by ListObjects.OmMetadataManagerImpl.getOzoneKey()usesStringUtils.isNotBlank(), which treats whitespace-only keys as absent, so the object is stored under /volume/bucket instead of /volume/bucket/.List object uses prefix
/volume/bucket/, so the key is omitted. Fix key encoding to allow whitespace-only namesWhat is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15618
How was this patch tested?
Added unit test.