-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Move query categorization changes to query insights plugin #14528
Conversation
❌ Gradle check result for 9e5a09a: 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? |
❌ Gradle check result for af58c5f: 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? |
❌ Gradle check result for 2bd1a05: 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? |
❌ Gradle check result for 68a226e: 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? |
❌ Gradle check result for 8dc38c4: 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? |
❌ Gradle check result for a4ad58e: 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? |
❌ Gradle check result for cdce692: 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: Siddhant Deshmukh <deshsid@amazon.com>
Signed-off-by: Siddhant Deshmukh <deshsid@amazon.com>
Signed-off-by: Siddhant Deshmukh <deshsid@amazon.com>
Signed-off-by: Siddhant Deshmukh <deshsid@amazon.com>
827085e
to
dc1fefb
Compare
❌ Gradle check result for dc1fefb: 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: Siddhant Deshmukh <deshsid@amazon.com>
❌ Gradle check result for 0906513: 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? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14528 +/- ##
==========================================
Coverage 71.77% 71.78%
+ Complexity 62302 62282 -20
==========================================
Files 5125 5127 +2
Lines 292473 292547 +74
Branches 42258 42269 +11
==========================================
+ Hits 209912 209991 +79
+ Misses 65324 65213 -111
- Partials 17237 17343 +106 ☔ View full report in Codecov by Sentry. |
❕ Gradle check result for eb8ebd8: 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. |
Signed-off-by: Siddhant Deshmukh <deshsid@amazon.com>
❌ Gradle check result for d419ca5: 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? |
❌ Gradle check result for d6b29c7: 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? |
...sights/src/main/java/org/opensearch/plugin/insights/core/listener/QueryInsightsListener.java
Show resolved
Hide resolved
...sights/src/main/java/org/opensearch/plugin/insights/core/listener/QueryInsightsListener.java
Outdated
Show resolved
Hide resolved
@@ -69,15 +77,27 @@ public class QueryInsightsService extends AbstractLifecycleComponent { | |||
*/ | |||
final QueryInsightsExporterFactory queryInsightsExporterFactory; | |||
|
|||
private volatile boolean searchQueryMetricsEnabled; |
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.
Why do you need a volatile boolean? Does the eventual consistency not work here?
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.
If searchQueryMetricsEnabled is not declared as volatile, changes made by one thread to searchQueryMetricsEnabled may not be immediately visible to other threads and could cause some issues.
...insights/src/main/java/org/opensearch/plugin/insights/core/service/QueryInsightsService.java
Show resolved
Hide resolved
...insights/src/main/java/org/opensearch/plugin/insights/core/service/QueryInsightsService.java
Outdated
Show resolved
Hide resolved
@@ -6,10 +6,12 @@ | |||
* compatible open source license. | |||
*/ | |||
|
|||
package org.opensearch.index.query; | |||
package org.opensearch.plugin.insights.core.service.categorizer; |
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.
nit: Should we really have service in the namespace?
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.
Had added categorizer in core earlier but @ansjcy mentioned that it might make more sense to keep it under service. I am okay either way.
...ain/java/org/opensearch/plugin/insights/core/service/categorizer/SearchQueryCategorizer.java
Show resolved
Hide resolved
/** | ||
* Query Insights search query categorizor to collect metrics related to search queries | ||
*/ | ||
package org.opensearch.plugin.insights.core.service.categorizer; |
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.
Most of the QueryCategorizer logic is independent of QueryInsightsService. Hence, categorizer should not be contained within service IMO.
Signed-off-by: Siddhant Deshmukh <deshsid@amazon.com>
Signed-off-by: Siddhant Deshmukh <deshsid@amazon.com>
❌ Gradle check result for 9b80e90: 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? |
@deshsidd - This PR can be discarded in favor of opensearch-project/query-insights#16, right? |
Closing in favor of : https://github.com/opensearch-project/OpenSearch/pull/14528/files |
Query categorization changes to increment counters for search query related metrics currently resides on the search path and occurs before the request.
Move these changes to the query insights plugin and make sure the incrementing of counters happens separately from the search path.
Another option is to keep query categorization changes as is. However, this will lead to additional overhead on the search path. Furthermore, we need to tie query latency, cpu, memory with the query categorization data which will only be possible if we increment the counters after the request is completed and the query latency and resource usage data resides inside the plugin.
To support the above and to prevent doing these counter increments on the search path, we need to move query categorization changes to the query insights plugin.
Related Issues
Resolves #14527
Addresses #11596
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.