-
Notifications
You must be signed in to change notification settings - Fork 715
fix: check if cache latest files enabled for cache local file #8219
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR fixes a configuration logic bug in the cache latest files system by adding missing checks for the master enabled flag across three critical files. The OpenObserve codebase has a hierarchical caching configuration system where cache_latest_files.enabled serves as the master switch that should gate all caching operations, with specific sub-flags like cache_parquet, cache_index, and download_from_node controlling individual caching behaviors.
The affected files were inconsistently checking the configuration flags:
src/job/files/parquet.rs: Missingenabledcheck in the ingester's parquet file caching logicsrc/service/compact/merge.rs: Missingenabledcheck in two locations within the compactor's merge operationssrc/service/tantivy/mod.rs: Missingenabledcheck in the Tantivy search index caching logic
The fix ensures that all three components now follow the same pattern: first check if cache_latest_files.enabled is true, then verify the specific feature flags (cache_parquet or cache_index), and finally confirm download_from_node is enabled. This creates consistent behavior where setting ZO_CACHE_LATEST_FILES_ENABLED=false will properly disable all local file caching operations across the ingester, compactor, and search indexing components.
Additionally, the Tantivy module change includes a minor optimization by caching the config reference in a local variable instead of calling get_config() multiple times.
Confidence score: 5/5
- This PR is safe to merge with minimal risk as it only adds missing configuration checks without changing core logic
- Score reflects simple, consistent changes that fix a clear configuration bug with no breaking changes to existing functionality
- No files require special attention as all changes follow the same straightforward pattern
3 files reviewed, no comments
User description
We also should check if cache latest files enabled when we try to cache local file to disk cache.
PR Type
Bug fix
Description
Guard caching with
enabledflagApply to parquet merge paths
Apply to Tantivy index caching
Prevent unintended disk writes
Diagram Walkthrough
File Walkthrough
parquet.rs
Guard parquet caching with global enable flagsrc/job/files/parquet.rs
cfg.cache_latest_files.enabledto conditionmerge.rs
Enforce enabled flag in merge caching pathssrc/service/compact/merge.rs
enabledcheck to first merge upload pathenabledcheck to secondary merge upload pathmod.rs
Respect enabled flag for Tantivy index cachingsrc/service/tantivy/mod.rs
get_config()incfgenabledcheck to index caching condition