feat(hns): remove empty-dir check before folder rename#4614
Draft
PranjalC100 wants to merge 1 commit intomasterfrom
Draft
feat(hns): remove empty-dir check before folder rename#4614PranjalC100 wants to merge 1 commit intomasterfrom
PranjalC100 wants to merge 1 commit intomasterfrom
Conversation
0e40c26 to
23376c1
Compare
23376c1 to
f7305ea
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4614 +/- ##
===========================================
+ Coverage 0 83.65% +83.65%
===========================================
Files 0 164 +164
Lines 0 20216 +20216
===========================================
+ Hits 0 16911 +16911
- Misses 0 2668 +2668
- Partials 0 637 +637
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR optimizes the
renameHierarchicalDiroperation for Hierarchical Namespace (HNS) buckets by removing the preliminarycheckDirNotEmptyvalidation step.Previously, GCSFuse performed a recursive listing of the destination directory via
ReadDescendants(translating to aListObjectscall withMaxResults=2) to verify it was empty before attempting a rename.By eliminating this redundant client-side check, we shift the validation burden to the native GCS backend, which inherently rejects the action if the destination is not empty. This saves a Class A
ListAPI operation, reducing latency and operational costs for customers, while maintaining strict POSIX compliance.This implementation covers the "Code Changes" task outlined in the HNS Folder Rename Optimization design document.
Link to the issue in case of a bug fix.
https://b.corp.google.com/issues/495920968
Testing details
os.renametests against mounted HNS buckets with TRACE logs enabled. Verified that renaming to a non-empty directory natively fails and returnsENOTEMPTYwithout triggering any preliminaryListObjectscalls.Any backward incompatible change? If so, please explain.
No backward incompatible changes. The error propagation to the OS (e.g.,
ENOTEMPTY) remains functionally identical.