BitsetFilterCache refactor: Change it to a node level cache with a size limit#21179
Conversation
PR Reviewer Guide 🔍(Review updated until commit 73f28fb)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 3af0257 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 94a1f9f
Suggestions up to commit 73f28fb
Suggestions up to commit 864718f
Suggestions up to commit 66619c5
Suggestions up to commit 6c5c879
|
|
❌ Gradle check result for a77d8b9: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
|
Persistent review updated to latest commit 7db9af0 |
|
Persistent review updated to latest commit dd3178c |
|
❌ Gradle check result for dd3178c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
|
Persistent review updated to latest commit 5ceb33c |
|
Persistent review updated to latest commit 21f368a |
Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
|
Persistent review updated to latest commit 6c5c879 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21179 +/- ##
============================================
+ Coverage 73.22% 73.31% +0.09%
- Complexity 73325 73541 +216
============================================
Files 5910 5911 +1
Lines 334422 334789 +367
Branches 48207 48231 +24
============================================
+ Hits 244880 245464 +584
+ Misses 69964 69738 -226
- Partials 19578 19587 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jainankitk
left a comment
There was a problem hiding this comment.
I noticed that code reviewer added some concerns here - #21179 (comment), in addition to my comments. Also, I am wondering if it is worthwhile breaking this down into 2 PRs (3 might be too much)?
- Sub-PR theme: Introduce IndicesBitsetFilterCache node-level cache with size limit
- Sub-PR theme: Wire IndicesBitsetFilterCache into IndexService and IndicesService + Sub-PR theme: Update test infrastructure to use IndicesBitsetFilterCache
Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
|
Persistent review updated to latest commit 66619c5 |
|
❌ Gradle check result for 66619c5: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
|
Persistent review updated to latest commit 864718f |
|
❌ Gradle check result for 864718f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
|
Persistent review updated to latest commit 73f28fb |
Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
|
❌ Gradle check result for 94a1f9f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
|
❕ Gradle check result for 3af0257: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
…ze limit (opensearch-project#21179) Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com> Signed-off-by: Abhishek Som <abhissom@amazon.com>
…ze limit (opensearch-project#21179) Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com> Signed-off-by: Divya <divyruhil999@gmail.com>
…ze limit (opensearch-project#21179) Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
…ze limit (opensearch-project#21179) Signed-off-by: Sagar Upadhyaya <sagar.upadhyaya.121@gmail.com>
Description
Earlier, BitsetFilterCache was created per index and without any size limit for each or all of the caches combined.
This PR changes this cache to a node level cache shared across the segment, and then puts a size limit. Defaults to 5% of the total heap available on the node, also a static node level setting.
It is also changing(or flattening) this cache structure from
Cache<K, Cache<K1, V1>>toCache<CK, V>where CK is a composite key<Segment, Query>. This logic was needed to be able to put a size limit on the cache.Other way to handle this would have been to implement our own custom cache and manage our own logic to calculate the size and impose a limit, but that's a even bigger change compared to the current approach taken.
We have now
IndicesBitsetFilterCache, a node level cache.BitsetFilterCacheis still used at an index level, but it eventually usesIndicesBitsetFilterCacheto store results, so it is only a thin layer now. Kept it to avoid backward compatibility issues.Related Issues
#21025
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.