-
Notifications
You must be signed in to change notification settings - Fork 715
fix: result cache for histogram #9483
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
|
Failed to generate code suggestions for PR |
Greptile OverviewGreptile SummaryThis PR fixes result caching for histogram queries by addressing several interconnected issues:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client
participant SearchService
participant CacheChecker as Cache Checker
participant CacheWriter as Cache Writer
participant PartitionGen as Partition Generator
Client->>SearchService: Search Request (histogram)
SearchService->>CacheChecker: check_cache(query, histogram_interval)
CacheChecker->>CacheChecker: get_cached_results()
alt Cache Hit
CacheChecker->>CacheChecker: Filter hits by interval-adjusted boundaries
CacheChecker->>CacheChecker: calculate_deltas(histogram_interval)
CacheChecker-->>SearchService: CachedQueryResponse + deltas
else Cache Miss
CacheChecker-->>SearchService: Empty response
end
SearchService->>PartitionGen: generate_partitions_aligned_with_histogram_interval()
PartitionGen->>PartitionGen: Align start/end to min_step boundaries
PartitionGen-->>SearchService: Partitions
SearchService->>SearchService: Execute search for delta partitions
SearchService->>CacheWriter: write_results()
CacheWriter->>CacheWriter: Align time range to histogram interval
CacheWriter->>CacheWriter: Filter hits within accept range
CacheWriter->>CacheWriter: Adjust end_time if need_adjust_end_time
CacheWriter->>CacheWriter: Cache to disk with aligned timestamps
SearchService-->>Client: Merged results (cached + fresh)
|
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.
7 files reviewed, no comments
|
Failed to generate code suggestions for PR |
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.
8 files reviewed, no comments
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.
Pull request overview
This PR fixes result caching issues for histogram queries by improving cache management and time range alignment. The main changes include:
- Removing the deletion of mismatched-interval aggregation cache files (now filtering is done during cache discovery instead)
- Fixing cache time range calculations for histogram queries to properly handle interval boundaries
- Adjusting partition generation logic to create alignment partitions for smaller durations
- Adding the
cache_intervalparameter todiscover_cache_for_queryto enable interval-based cache filtering - Improving logging consistency and adding performance timing metrics
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/service/search/streaming/mod.rs |
Enhanced logging (debug→info), fixed remaining_query_range calculation, added search completion timing |
src/service/search/streaming/execution.rs |
Removed mismatched-interval cache deletion logic, improved partition logging |
src/service/search/streaming/cache.rs |
Added timing metrics and improved log formatting |
src/service/search/partition.rs |
Changed histogram partition alignment threshold from 3*min_step to min_step, moved mini_partition_size calculation |
src/service/search/mod.rs |
Updated log message formatting, added cache_interval parameter to discover_cache_for_query call |
src/service/search/cache/mod.rs |
Fixed cache time range adjustment for histograms, improved variable naming (cached_responses vs search_responses), added timing logs |
src/service/search/cache/cacher.rs |
Enhanced histogram interval handling, fixed delta calculation for histogram queries, improved conditional caching logic |
src/config/src/meta/search.rs |
Added PartialOrd trait to Interval enum for interval comparisons |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.