Skip to content

Conversation

@Tulsishah
Copy link
Collaborator

@Tulsishah Tulsishah commented Jan 7, 2026

Description

Implicit directories in GCS exist only as prefixes of child objects. Once the last child is deleted, the directory automatically "disappears." Sending a DeleteObject request for an implicit directory is unnecessary and returns a 404 Not Found error, yet the entry may still exist in the local metadata cache.

Introduce an OnlyDeleteFromCache flag to DeleteObjectRequest. This allows the system to invalidate the local cache without making a redundant remote call to GCS when dealing with implicit directories.

Implementation:

  1. Request Flag: Add OnlyDeleteFromCache bool to the DeleteObjectRequest struct.
  2. Inode Logic: In DeleteChildDir, if isImplicitDir is true, set OnlyDeleteFromCache = true.
  3. Bucket Handling: In DeleteObject, if the flag is set, call addNegativeEntry() to clear the cache and return nil immediately, bypassing the GCS network call.

Link to the issue in case of a bug fix.

b/473955961

Testing details

  1. Manual - NA
  2. Unit tests - Added
  3. Integration tests - Automated

Any backward incompatible change? If so, please explain.

@Tulsishah Tulsishah added execute-integration-tests Run only integration tests execute-integration-tests-on-zb To run E2E tests on zonal bucket. type-cache-deprecation labels Jan 7, 2026
@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.06%. Comparing base (2cbaedd) to head (8914864).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4249   +/-   ##
=======================================
  Coverage   83.06%   83.06%           
=======================================
  Files         156      156           
  Lines       19173    19172    -1     
=======================================
  Hits        15926    15926           
+ Misses       2654     2653    -1     
  Partials      593      593           
Flag Coverage Δ
unittests 83.06% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Tulsishah Tulsishah force-pushed the delete_implicit_dir branch from e8ca373 to 9f45831 Compare January 9, 2026 05:17
@Tulsishah Tulsishah force-pushed the delete_implicit_dir branch from 9f45831 to d08eb4e Compare January 9, 2026 05:18
@Tulsishah Tulsishah force-pushed the delete_implicit_dir branch 4 times, most recently from a7f640b to 8600dc2 Compare January 9, 2026 06:01
@Tulsishah Tulsishah force-pushed the delete_implicit_dir branch from 8600dc2 to 7de3e0f Compare January 9, 2026 06:03
@Tulsishah
Copy link
Collaborator Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an OnlyDeleteFromCache flag to DeleteObjectRequest to optimize the deletion of implicit GCS directories. When this flag is set, the system avoids a redundant network call to GCS and only invalidates the local metadata cache. The changes are logical and well-supported by new unit tests. My review includes a couple of suggestions to remove redundant code and to refactor the new tests for better maintainability.

@Tulsishah Tulsishah force-pushed the delete_implicit_dir branch from d7b9ad6 to afa01ef Compare January 9, 2026 06:11
@Tulsishah Tulsishah marked this pull request as ready for review January 9, 2026 07:55
@Tulsishah Tulsishah requested a review from a team as a code owner January 9, 2026 07:55
@github-actions github-actions bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Jan 9, 2026
@github-actions
Copy link

Hi @vadlakondaswetha, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

@Tulsishah Tulsishah removed execute-integration-tests Run only integration tests execute-integration-tests-on-zb To run E2E tests on zonal bucket. remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. labels Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants