You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
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
The reason will be displayed to describe this comment to others.Learn more.
Greptile Overview
Greptile Summary
This PR fixes metrics parquet file searching in WAL by properly handling partition time levels (daily vs hourly), and refactors cache control from negativeno_cache to positiveuse_cache semantics.
Key Changes:
Fixed WAL parquet search to respectpartition_time_level setting, correctly aligning time ranges to either daily or hourly boundaries based on stream configuration
Refactored cache control fromno_cache touse_cache throughout the codebase for clearer intent
Added cache update logic that allows queries with caching disabled to still update existing cache entries
Implemented frontend support forwindow.use_cache override to control query caching behavior during development/debugging
Issue Found:
Comment on line 100 insrc/service/promql/search/mod.rs incorrectly describes the logic (says "use_cache is true" when it should say "use_cache is false")
Confidence Score: 4/5
This PR is safe to merge with one minor documentation fix needed
The changes are well-structured and address the stated issues. The partition time level fix is correct and properly threaded through the codebase. The cache semantics refactor is consistent across all files. Only issue is an incorrect comment that doesn't affect functionality
src/service/promql/search/mod.rs needs comment correction on line 100
Important Files Changed
File Analysis
Filename
Score
Overview
src/service/search/grpc/wal.rs
5/5
Addedpartition_time_level parameter to correctly handle daily vs hourly partitioning when searching parquet files in WAL for metrics
src/service/promql/search/mod.rs
4/5
Changed fromno_cache touse_cache semantics, added cache update logic; comment on line 100 needs correction
src/service/promql/search/cache/mod.rs
5/5
Addedupdate parameter toset() function to control whether cache should be updated even when already covered
web/src/services/search.ts
5/5
Added support forwindow.use_cache override in frontend to control query caching behavior
Sequence Diagram
sequenceDiagram participant Client as Web Client participant HTTP as HTTP Handler participant Search as PromQL Search participant Cache as Cache Service participant Cluster as Cluster RPC participant WAL as WAL Search participant Parquet as Parquet Files Client->>HTTP: query_range(query, use_cache) HTTP->>Search: search_in_cluster(req) Note over Search: Check if cache_disabled<br/>(!use_cache || !cache_enabled) alt Cache enabled and use_cache=true Search->>Cache: get(query, start, end) Cache-->>Search: cached data (if exists) end Search->>Cluster: distribute query to nodes Cluster->>WAL: search_parquet(query) Note over WAL: Get partition_time_level<br/>from stream settings alt Daily Partitioning WAL->>WAL: Align to DAY_MICRO_SECS else Hourly Partitioning WAL->>WAL: Align to HOUR_MICRO_SECS end WAL->>Parquet: scan files in time range Parquet-->>WAL: record batches WAL-->>Cluster: results Cluster-->>Search: aggregated results alt Cache enabled Search->>Cache: set(query, results, update=!cache_disabled) Note over Cache: Update cache if needed end Search-->>HTTP: query results HTTP-->>Client: response
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.
Uh oh!
There was an error while loading.Please reload this page.
window.use_cache=falsefor metrics to skip query cache