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

   This is a resubmitted MR, the old one is  
https://github.com/apache/ozone/pull/3774
   This MR fixes an issue that may be making ITestOzoneContractMkdir flaky.
   
   ## What changes were proposed in this pull request?
   
   Fix exception when '/' in key name
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-7253
   
   ## How was this patch tested?
   
   How to reproduce the bug
   
   - First put a key that containing '/'
   
   ```bash
   [root@Linux /root/ozone]% bin/ozone sh key put s3v/testbucket/dir1/dir2/key1 
~/testfile
   [root@Linux /root/ozone]% bin/ozone sh key ls s3v/testbucket/ | grep name
     "name" : "dir1/dir2/key1"
   ```
   - Execute command
   
   `ls` command for keys containing '/'
   before this commit
   ```bash
   [root@Linux /root/ozone]% bin/ozone fs -ls ofs://localhost/s3v/testbucket/
   Found 1 items
   drwxrwxrwx   - root root          0 2022-09-19 14:11 
ofs://localhost/s3v/testbucket/dir1
   [root@Linux /root/ozone]% bin/ozone fs -ls 
ofs://localhost/s3v/testbucket/dir1
   ls: `ofs://localhost/s3v/testbucket/dir1': No such file or directory
   ```
   after this commit
   ```bash
   [root@Linux /root/ozone]% bin/ozone fs -ls ofs://localhost/s3v/testbucket/
   Found 1 items
   drwxrwxrwx   - root root          0 2022-09-19 14:37 
ofs://localhost/s3v/testbucket/dir1
   [root@Linux /root/ozone]% bin/ozone fs -ls 
ofs://localhost/s3v/testbucket/dir1
   Found 1 items
   drwxrwxrwx   - root root          0 2022-09-19 14:37 
ofs://localhost/s3v/testbucket/dir1/dir2
   ```
   
   for `mv`, `mkdir`, `count` command for keys containing '/' 
   
   
   
   before this commit 
   ```bash
   [root@Linux /root/ozone]% bin/ozone fs -count ofs://localhost/s3v/testbucket/
   count: dir1: No such file or directory!
   [root@Linux /root/ozone]% bin/ozone fs -mv 
ofs://localhost/s3v/testbucket/dir1 ofs://localhost/s3v/testbucket/dir2
   mv: `ofs://localhost/s3v/testbucket/dir1': No such file or directory
   [root@Linux /root/ozone]% bin/ozone fs -mkdir 
ofs://localhost/s3v/testbucket/dir1/dir2/key2
   mkdir: `ofs://localhost/s3v/testbucket/dir1/dir2': No such file or directory
   ```
   after this commit
   ```bash
   [root@Linux /root/ozone]% bin/ozone fs -count ofs://localhost/s3v/testbucket/
              3            1            1048576 ofs://localhost/s3v/testbucket
   [root@Linux /root/ozone]% bin/ozone fs -mv 
ofs://localhost/s3v/testbucket/dir1 ofs://localhost/s3v/testbucket/newdir1
   [root@Linux /root/ozone]% bin/ozone fs -ls ofs://localhost/s3v/testbucket/
   Found 1 items
   drwxrwxrwx   - root root          0 2022-09-19 14:39 
ofs://localhost/s3v/testbucket/newdir1
   [root@Linux /root/ozone]% bin/ozone fs -mkdir 
ofs://localhost/s3v/testbucket/newdir1/dir2/dir3
   [root@Linux /root/ozone]% bin/ozone fs -ls 
ofs://localhost/s3v/testbucket/newdir1/dir2/
   Found 2 items
   drwxrwxrwx   - root root          0 2022-09-19 14:43 
ofs://localhost/s3v/testbucket/newdir1/dir2/dir3
   -rw-rw-rw-   3 root root    1048576 2022-09-19 14:39 
ofs://localhost/s3v/testbucket/newdir1/dir2/key1
   ```
   


-- 
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