Skip to content

Conversation

@smengcl
Copy link
Contributor

@smengcl smengcl commented Feb 10, 2026

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 checkSubFileExists or checkSubDirectoryExists.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14600

How was this patch tested?

  • New unit test case added.
  • New integration test case added.

… not empty" despite all children deleted when double buffer is not flushed
Copilot AI review requested due to automatic review settings February 10, 2026 02:20
Copy link
Contributor

Copilot AI left a 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#checkSubDirectoryExists and checkSubFileExists to 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#delete API.

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.

Copy link
Contributor

Copilot AI left a 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.

@smengcl smengcl added the bug Something isn't working label Feb 11, 2026
@smengcl smengcl self-assigned this Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant