-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-14600. [FSO] Non-recursive dir deletion fails with "Directory is not empty" despite all children deleted when double buffer is not flushed #9739
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
base: master
Are you sure you want to change the base?
Conversation
… not empty" despite all children deleted when double buffer is not flushed
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.
Pull request overview
Fixes an FSO bucket bug where non-recursive directory deletion can incorrectly fail with Directory is not empty after children were deleted, due to tombstoned (cache-deleted but not yet DB-flushed) entries still being observed from RocksDB during hasChildren() checks.
Changes:
- Update
OMFileRequest#checkSubDirectoryExistsandcheckSubFileExiststo ignore DB entries that are marked deleted (tombstoned) in the table cache. - Add a unit test reproducing the failure mode at the OM request level.
- Add an integration test reproducing the failure via the public
FileSystem#deleteAPI.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java | Adjusts child-existence checks to account for cache tombstones vs DB visibility. |
| hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyDeleteRequestWithFSO.java | Adds a focused unit regression test for deleting parent after deleting children. |
| hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTestWithFSO.java | Adds an integration regression test using FileSystem APIs and double-buffer manipulation to reproduce the bug. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTestWithFSO.java
Outdated
Show resolved
Hide resolved
...ration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTestWithFSO.java
Show resolved
Hide resolved
...ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java
Outdated
Show resolved
Hide resolved
...ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java
Outdated
Show resolved
Hide resolved
...ager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyDeleteRequestWithFSO.java
Outdated
Show resolved
Hide resolved
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.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What changes were proposed in this pull request?
This PR fixes a bug when using FSO buckets, non-recursive directory deletion could fail with "Directory is not empty" error after all children have been successfully deleted.
The issue is that cache tombstones are not properly checked in
checkSubFileExistsorcheckSubDirectoryExists.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14600
How was this patch tested?