Skip to content
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-7253. Fix exception when '/' in key name #4038

Merged
merged 10 commits into from Dec 4, 2022

Conversation

xichen01
Copy link
Contributor

@xichen01 xichen01 commented Dec 3, 2022

This is a resubmitted MR, the old one is #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 '/'
[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

[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

[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

[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

[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

@kaijchen
Copy link
Contributor

kaijchen commented Dec 3, 2022

100x ITestOzoneContractMkdir: https://github.com/kaijchen/ozone/actions/runs/3609358975

Copy link
Contributor

@kaijchen kaijchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the regression in #3774 has been fixed.
@sadanand48 Do you want to take another look?

@kaijchen kaijchen merged commit 069e038 into apache:master Dec 4, 2022
@kaijchen
Copy link
Contributor

kaijchen commented Dec 4, 2022

Thanks @xichen01 for the update.

@kaijchen
Copy link
Contributor

kaijchen commented Dec 4, 2022

Looks like TestObjectStoreWithLegacyFS.testFlatKeyStructureWithOBS is flaky:
https://github.com/apache/ozone/actions/runs/3612387380/jobs/6087464989#step:5:3182

@kaijchen
Copy link
Contributor

kaijchen commented Dec 4, 2022

100x TestObjectStoreWithLegacyFS :
https://github.com/kaijchen/ozone/actions/runs/3613121247

@xichen01, sometimes after a rename, the old keyName is still in table:

2022-12-04 20:13:06,066 [Time-limited test] WARN  om.TestObjectStoreWithLegacyFS (TestObjectStoreWithLegacyFS.java:assertKeyCount(160)) - keyName: /dnhdqlmxyt/iskcvwgnho/dir1/dir2/dir3/key-1, expected prefix: /dnhdqlmxyt/iskcvwgnho/dir, suffix: dir1/dir2/dir3/key-1
// renaming "dir1/dir2/dir3/key-1" to "dir1/NewKey-1"
2022-12-04 20:13:06,082 [Time-limited test] WARN  om.TestObjectStoreWithLegacyFS (TestObjectStoreWithLegacyFS.java:assertKeyCount(160)) - keyName: /dnhdqlmxyt/iskcvwgnho/dir1/dir2/dir3/key-1, expected prefix: /dnhdqlmxyt/iskcvwgnho/dir, suffix: dir1/NewKey-1

@kaijchen
Copy link
Contributor

kaijchen commented Dec 4, 2022

Seems this issue exists before this PR, but with a smaller chance (1/300 vs 2/100).
https://github.com/kaijchen/ozone/actions/runs/3613290473/jobs/6089472749#step:5:3351

The problem is probably due to write cache then read db without cache.
I have created HDDS-7588 to track it.

Galsza pushed a commit to Galsza/ozone that referenced this pull request Dec 7, 2022
errose28 added a commit to errose28/ozone that referenced this pull request Dec 12, 2022
* master: (110 commits)
  HDDS-7472. EC: Fix NSSummaryEndpoint#getDiskUsage for EC keys (apache#3987)
  HDDS-5704. Ozone URI syntax description in help content needs to mention about ozone service id (apache#3862)
  HDDS-7555. Upgrade Ratis to 2.4.2-8b8bdda-SNAPSHOT. (apache#4028)
  HDDS-7541. FSO recursive delete directory with hierarchy takes much time for cleanup (apache#4008)
  HDDS-7581. Fix update-jar-report for snapshot (apache#4034)
  HDDS-7253. Fix exception when '/' in key name (apache#4038)
  HDDS-7579. Use Netty 4.1.77 for consistency (apache#4031)
  HDDS-7562. Suppress warning about long filenames in tar (apache#4017)
  HDDS-7563. Add a handler for under replicated Ratis containers in RM (apache#4025)
  HDDS-7497. Fix mkdir does not update bucket's usedNamespace (apache#3969)
  HDDS-7567. Invalid entries in LICENSE (apache#4020)
  HDDS-7575. Correct showing of RATIS-THREE icon in Recon UI (apache#4026)
  HDDS-7540. Let reusable workflow inherit secrets (apache#4012)
  HDDS-7568. Bump copyright year in NOTICE (apache#4018)
  HDDS-7394. OM RPC FairCallQueue decay decision metrics list caller username in the metric (apache#3878)
  HDDS-7510. Recon: Return number of open containers in `/clusterState` endpoint (apache#3989)
  HDDS-7561. Improve setquota, clrquota CLI usage (apache#4016)
  HDDS-6615. EC: Improve write performance by pipelining encode and flush (apache#3994)
  HDDS-7554. Recon UI should show DORMANT in pipeline status filter (apache#4010)
  HDDS-7540. Separate scheduled CI from push/PR workflows (apache#4004)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants