Skip to content

Conversation

@Tulsishah
Copy link
Collaborator

@Tulsishah Tulsishah commented Jan 6, 2026

Description

  • Request Struct Updates: The StatObjectRequest, ListObjectsRequest, and a newly introduced GetFolderRequest now include IsTypeCacheDeprecated and FetchOnlyFromCache flags.
  • Cache Miss Handling: In the fastStatBucket implementation, if FetchOnlyFromCache is enabled and a cache miss occurs, the system returns a new CacheMissError instead of falling back to GCS.
  • Interface Refactoring: The GetFolder method across various bucket implementations and interfaces (including Bucket, bucketHandle, and debugBucket) was refactored to accept a GetFolderRequest struct rather than a simple string for the folder name

Link to the issue in case of a bug fix.

b/473671143

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. labels Jan 6, 2026
@Tulsishah Tulsishah force-pushed the fetch_from_cache_arg_in_req_struct branch 2 times, most recently from 6089975 to df74e56 Compare January 6, 2026 05:28
@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 79.54545% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.11%. Comparing base (8985dad) to head (db0df34).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
internal/storage/debug_bucket.go 0.00% 3 Missing ⚠️
internal/monitor/bucket.go 0.00% 2 Missing ⚠️
internal/ratelimit/throttled_bucket.go 0.00% 2 Missing ⚠️
internal/storage/caching/fast_stat_bucket.go 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4243      +/-   ##
==========================================
+ Coverage   83.09%   83.11%   +0.01%     
==========================================
  Files         154      156       +2     
  Lines       18980    19173     +193     
==========================================
+ Hits        15772    15935     +163     
- Misses       2631     2648      +17     
- Partials      577      590      +13     
Flag Coverage Δ
unittests 83.11% <79.54%> (+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 marked this pull request as ready for review January 6, 2026 08:37
@Tulsishah Tulsishah requested a review from a team as a code owner January 6, 2026 08:37
@Tulsishah Tulsishah requested a review from raj-prince January 6, 2026 08:37
@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 6, 2026
@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 refactors the GetFolder function across various bucket abstraction layers to accept a *gcs.GetFolderRequest struct instead of a direct folder name string, with corresponding updates to test files. The gcs.GetFolderRequest struct, along with StatObjectRequest and ListObjectsRequest, now includes a FetchFromCache boolean field. Review comments indicate that the FetchFromCache flag is not yet implemented for StatObject within fastStatBucket.StatObject and that fastStatBucket.ListObjects does not currently utilize caching for listings, prompting a need for further implementation or clarification on future plans.

@Tulsishah Tulsishah force-pushed the fetch_from_cache_arg_in_req_struct branch 3 times, most recently from e362824 to 2cf7164 Compare January 7, 2026 03:12
@Tulsishah Tulsishah changed the title feat(Type Cache Deprecation): Add FetchFromCache arg in req struct feat(Type Cache Deprecation): Add FetchFromCache flag and support implicit directory caching in Stat Cache Jan 7, 2026
@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 a FetchFromCache flag to give callers explicit control over using the stat cache, which is a useful feature for performance tuning and consistency. The changes are well-contained, primarily affecting the fastStatBucket and propagating the new request structs through various bucket wrappers.

My review focuses on the new caching logic in fast_stat_bucket.go. I've identified a couple of areas for improvement:

  • A potential panic due to an unsafe type assertion in ListObjects.
  • A minor formatting inconsistency in an error message.

The addition of extensive unit tests for the new caching scenarios is excellent and greatly improves confidence in the changes. Overall, this is a solid contribution.

@Tulsishah Tulsishah changed the title feat(Type Cache Deprecation): Add FetchFromCache flag and support implicit directory caching in Stat Cache feat(Type Cache Deprecation): Add FetchFromCache flag and enable/disable caching with respect to flag value Jan 7, 2026
@Tulsishah Tulsishah force-pushed the fetch_from_cache_arg_in_req_struct branch from 384b757 to b8f1a0e Compare January 7, 2026 05:08
@Tulsishah Tulsishah added type-cache-deprecation and removed remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. labels Jan 7, 2026
@Tulsishah Tulsishah removed the request for review from raj-prince January 7, 2026 05:43
@Tulsishah Tulsishah force-pushed the fetch_from_cache_arg_in_req_struct branch from 185f2e6 to 4102b55 Compare January 8, 2026 06:18
@Tulsishah Tulsishah changed the title feat(Type Cache Deprecation): Add FetchFromCache flag and enable/disable caching with respect to flag value feat(Type Cache Deprecation): Add FetchOnlyFromCache flag and enable/disable caching with respect to flag value Jan 8, 2026
@Tulsishah Tulsishah force-pushed the fetch_from_cache_arg_in_req_struct branch 3 times, most recently from 5e175c8 to 7b17e72 Compare January 8, 2026 14:31
@Tulsishah Tulsishah force-pushed the fetch_from_cache_arg_in_req_struct branch from 7b17e72 to db0df34 Compare January 8, 2026 14:36
@Tulsishah Tulsishah removed the execute-integration-tests-on-zb To run E2E tests on zonal bucket. label Jan 9, 2026
@Tulsishah Tulsishah enabled auto-merge (squash) January 9, 2026 04:52
@Tulsishah Tulsishah merged commit 2cbaedd into master Jan 9, 2026
15 checks passed
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