-
Notifications
You must be signed in to change notification settings - Fork 590
HDDS-7253. Fix exception when '/' in key name #3774
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
sadanand48
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.
@xichen01 This is not a bug but expected behaviour. By default , if you don't specify any bucket layout while creating, the bucket layout is LEGACY and the property ozone.om.enable.filesystem.paths is false by default. If the property is set to true , this issue wont occur i.e intermediate directories will be created. You could also create FSO buckets which would by default create intermediate dirs.
|
when '/' in key name the ozone/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java Lines 1700 to 1711 in 6c1a5ee
The problem I'm currently having is that I can't use the |
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.
when '/' in key name the listSatus will create a fake directory return to the client. The client will get the fake directory info through getfileStatus, but currently getfileStatus has no logic for fake directory, this is inconsistent with listStatus behavior, So some exceptions occur.
This PR is to make listStatus and getFileStatus have the same behavior.
Thanks for explaining @xichen01. This would make the user see a filesystem consistent view of the keys created in legacy buckets (using fake dirs) . Overall the change looks good, just dropped some minor comments.
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyManagerImpl.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyManagerImpl.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystem.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystem.java
Outdated
Show resolved
Hide resolved
|
cc @duongkame |
|
@sadanand48 PTAL Thanks. |
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 @xichen01 The patch looks good overall , just left few minor comments. PTAL
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyManagerImpl.java
Outdated
Show resolved
Hide resolved
duongkame
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.
+1, LGTM.
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
Show resolved
Hide resolved
sadanand48
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.
Thanks @xichen01 for updating the PR. +1 LGTM.
|
Thanks @xichen01 for the work, @duongkame and @sadanand48 for the review. |
|
Sorry I have to revert this commit because it's making |
|
@kaijchen Are there some failed operations I can refer to them? So I can find out which tests are flaky. |
Here is one of the failing case, but not the only one. Please run ITestOzoneContractMkdir multiple times to find out more. |
* master: (718 commits) HDDS-7342. Move encryption-related code from MultipartCryptoKeyInputStream to OzoneCryptoInputStream (apache#3852) HDDS-7413. Fix logging while marking container state unhealthy (apache#3887) Revert "HDDS-7253. Fix exception when '/' in key name (apache#3774)" HDDS-7396. Force close non-RATIS containers in ReplicationManager (apache#3877) HDDS-7121. Support namespace summaries (du, dist & counts) for legacy FS buckets (apache#3746) HDDS-7258. Cleanup the allocated but uncommitted blocks (apache#3778) HDDS-7381. Cleanup of VolumeManagerImpl (apache#3873) HDDS-7253. Fix exception when '/' in key name (apache#3774) HDDS-7182. Add property to control RocksDB max open files (apache#3843) HDDS-7284. JVM crash for rocksdb for read/write after close (apache#3801) HDDS-7368. [Multi-Tenant] Add Volume Existence check in preExecute for OMTenantCreateRequest (apache#3869) HDDS-7403. README Security Improvement (apache#3879) HDDS-7199. Implement new mix workload Read/Write Freon command (apache#3872) HDDS-7248. Recon: Expand the container status page to show all unhealthy container states (apache#3837) HDDS-7141. Recon: Improve Disk Usage Page (apache#3789) HDDS-7369. Fix wrong order of command arguments in Nonrolling-Upgrade.md (apache#3866) HDDS-6210. EC: Add EC metrics (apache#3851) HDDS-7355. non-primordial scm fail to get signed cert from primordial SCM when converting an unsecure cluster to secure (apache#3859) HDDS-7356. Update SCM-HA.zh.md to match the English version (apache#3861) HDDS-6930. SCM,OM,RECON should not print ERROR and exit with code 1 on successful shutdown (apache#3848) ... Conflicts: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/LegacyReplicationManager.java hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java
|
@xichen01 I think it would be better to have this fix, could you please take a look at the failures. |
|
@xichen01 I can help take a look if you need. |
|
@sadanand48 @kaijchen Okay, I'll check this PR, I've looked at it briefly before, but I haven't identified possible reasons causing ITestOzoneContractMkdir flaky. |
yeah, thank you, I think it would be helpful, and if you have time, I will prioritize this issue as well |
|
@xichen01 FYI, here is ITestOzoneContractMkdir repeated 100x with this PR merged. |
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
lscommand for keys containing '/'before this commit
[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 directoryafter this commit
for
mv,mkdir,countcommand for keys containing '/'before this commit
after this commit
[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