-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Disable request cache for queries on fields with non-default use_similarity or split_queries_on_whitespace
#19385
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
Disable request cache for queries on fields with non-default use_similarity or split_queries_on_whitespace
#19385
Conversation
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
|
❌ Gradle check result for 5c5f4d4: 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: Peter Alfonsi <[email protected]>
|
❌ Gradle check result for 6157c8a: 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? |
|
@peteralfonsi Instead of trying to find ways to invalidate the cache by listening on mapper events, should we instead not cache the queries for such indices which uses In |
|
@sgup432 I think it makes more sense to keep these queries cacheable for a couple reasons:
|
|
Okay, I was hoping that we avoiding such indices to be cached might be a more simpler solution. As I don't think we will gain a lot overall caching such queries. But seems like even with my approach, we might have to tackle this case by case which I was trying to avoid in the first place. |
server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java
Outdated
Show resolved
Hide resolved
use_similarity or split_queries_on_whitespace
This reverts commit 57da039. Signed-off-by: Peter Alfonsi <[email protected]>
This reverts commit 87fbc14. Signed-off-by: Peter Alfonsi <[email protected]>
This reverts commit edc7b38. Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
51932ec to
2a5f188
Compare
Signed-off-by: Peter Alfonsi <[email protected]>
|
❌ Gradle check result for 624d2b8: 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: Peter Alfonsi <[email protected]>
|
❌ Gradle check result for dc2c277: 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? |
|
Flaky test (org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT.test {p0=search/310_match_bool_prefix/multi_match single field complete term} is mentioned specifically in the issue): #14294 |
Signed-off-by: Peter Alfonsi <[email protected]>
|
❌ Gradle check result for 27f5b42: 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: Peter Alfonsi <[email protected]>
|
❕ Gradle check result for 274c90f: 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19385 +/- ##
============================================
+ Coverage 72.81% 73.00% +0.18%
- Complexity 69854 69930 +76
============================================
Files 5676 5676
Lines 321048 321067 +19
Branches 46420 46421 +1
============================================
+ Hits 233774 234383 +609
+ Misses 68376 67677 -699
- Partials 18898 19007 +109 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ilarity` or `split_queries_on_whitespace` (opensearch-project#19385) --------- Signed-off-by: Peter Alfonsi <[email protected]> Signed-off-by: Peter Alfonsi <[email protected]> Co-authored-by: Peter Alfonsi <[email protected]>
…ilarity` or `split_queries_on_whitespace` (opensearch-project#19385) --------- Signed-off-by: Peter Alfonsi <[email protected]> Signed-off-by: Peter Alfonsi <[email protected]> Co-authored-by: Peter Alfonsi <[email protected]>
…ilarity` or `split_queries_on_whitespace` (opensearch-project#19385) --------- Signed-off-by: Peter Alfonsi <[email protected]> Signed-off-by: Peter Alfonsi <[email protected]> Co-authored-by: Peter Alfonsi <[email protected]>
Description
Some dynamically updateable parameters can change query results, for example "use_similarity" and "split_queries_on_whitespace" for keyword indices. This means that after changing them, users can get stale/incorrect values from the request cache. This PR prevents this by disabling caching queries which are on fields with non-default values for these parameters. This should be an acceptable solution as users opting into the non-default parameter should be fairly rare.
Related Issues
#19279
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.