Skip to content
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

Warn on md-prefetch enabled w/o md-cache #1944

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gargnitingoogle
Copy link
Collaborator

@gargnitingoogle gargnitingoogle commented May 24, 2024

Description

Warn on md-prefetch enabled w/o md-cache

In other words, log warnings if user has enabled metadata-prefetch through metadata-prefetch-on-mount flag but has either the type-cache or the stat-cache disabled through their ttl or size.

This is on top of #1930

Link to the issue in case of a bug fix.

NA

Testing details

  1. Manual - Manually tested and got expected warnings.
  2. Unit tests - Added new tests. Existing tests passed.
  3. Integration tests - Through presubmits.

Copy link

codecov bot commented May 24, 2024

Codecov Report

Attention: Patch coverage is 72.22222% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 60.78%. Comparing base (d086815) to head (e7bbd0a).

Files Patch % Lines
mount.go 72.22% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1944      +/-   ##
==========================================
+ Coverage   60.76%   60.78%   +0.01%     
==========================================
  Files         130      130              
  Lines       12397    12415      +18     
==========================================
+ Hits         7533     7546      +13     
- Misses       4526     4531       +5     
  Partials      338      338              
Flag Coverage Δ
unittests 60.78% <72.22%> (+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.

Base automatically changed from gargnitin/listing-during-mount/production/v1 to master May 24, 2024 10:21
@gargnitingoogle gargnitingoogle force-pushed the gargnitin/listing-during-mount/production/v2 branch from 1b785ca to e7bbd0a Compare May 24, 2024 13:35
@gargnitingoogle gargnitingoogle marked this pull request as ready for review May 24, 2024 13:39
@gargnitingoogle gargnitingoogle requested a review from a team as a code owner May 24, 2024 13:39
}

func isTypeCacheEnabled(metadataCacheTTL time.Duration, typeCacheMaxSizeMB int) bool {
if metadataCacheTTL <= 0 || typeCacheMaxSizeMB == 0 || typeCacheMaxSizeMB < -1 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

check if typeCacheMaxSizeMB < -1 is required or not. if not why and if yes why.

return true
}

func isStatCacheEnabled(metadataCacheTTL time.Duration, statCacheMaxSizeMB uint64) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we add these helper methods and their test cases somewhere apt inside internal directory ? trying to keep main.go clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants