-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add verbose pipeline parameter to output each processor's execution details #16843
base: main
Are you sure you want to change the base?
Add verbose pipeline parameter to output each processor's execution details #16843
Conversation
d5a2c4c
to
d931750
Compare
Signed-off-by: Junwei Dai <[email protected]>
a805cd9
to
021ecec
Compare
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.
Good start.
Few questions
-
Search pipelines can be used 3 ways: using it as default pipeline, as a temporary search request and through query param. Before applying the verbose pipeline param, we should check if search pipeline is applied in the Search Request. You have mentioned that in the RFC in resolvePipeline but I don't see the check in the PR.
-
Once the check is done then need 3 more tests for verbose pipeline execution with all the ways mentioned above
We are touching few core search files. @msfroh can you take a look at it too?
@@ -302,6 +305,9 @@ public SearchSourceBuilder(StreamInput in) throws IOException { | |||
if (in.getVersion().onOrAfter(Version.V_2_18_0)) { | |||
searchPipeline = in.readOptionalString(); | |||
} | |||
if (in.getVersion().onOrAfter(Version.CURRENT)) { |
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.
This is a general BWC dance we do for such cases, we don't need an issue to track this. @junweid62 can take care of it by following the below
- Do this on main with
onOrAfter(Version.V_3_0_0))
. Get it merged. - You'll need a manual backport to 2.x, where you do
onOrAfter(Version.V_2_19_0)
. Don't get it merged right away. - Before merging the backport to 2.x, open another PR on main to change it to onOrAfter(Version.V_2_19_0).
- Merge the backport PR.
- Merge the main version update PR.
server/src/main/java/org/opensearch/search/pipeline/ProcessorExecutionDetail.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/pipeline/ProcessorExecutionDetail.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/pipeline/ProcessorExecutionDetail.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/pipeline/ProcessorExecutionDetail.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/pipeline/PipelineProcessingContext.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/opensearch/action/search/SearchResponseTests.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Junwei Dai <[email protected]>
Let's make sure to include the status, plus any associated error message at a per-processor granularity as well. |
Signed-off-by: Junwei Dai <[email protected]>
2.refactor error message Signed-off-by: Junwei Dai <[email protected]>
Signed-off-by: Junwei Dai <[email protected]>
❌ Gradle check result for 7276e6c: 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? |
server/src/main/java/org/opensearch/search/pipeline/Pipeline.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/pipeline/PipelineProcessingContext.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/pipeline/Pipeline.java
Outdated
Show resolved
Hide resolved
2.Removed redundant logic for cleaner and simpler implementation. Signed-off-by: Junwei Dai <[email protected]>
Hi @msfroh, thank you for your detailed feedback. I have addressed all your comments and made the suggested changes, please take a look and let me know if any further adjustments are needed. |
Signed-off-by: Junwei Dai <[email protected]>
❌ Gradle check result for 2c5759d: 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: Junwei Dai <[email protected]>
❌ Gradle check result for 2c16992: 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: Junwei Dai <[email protected]>
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.
Almost there! Good work @junweid62
server/src/main/java/org/opensearch/search/pipeline/TrackingSearchRequestProcessorWrapper.java
Show resolved
Hide resolved
server/src/test/java/org/opensearch/search/pipeline/SearchPipelineServiceTests.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/pipeline/TrackingSearchResponseProcessorWrapper.java
Show resolved
Hide resolved
@@ -156,7 +160,7 @@ void transformRequest(SearchRequest request, ActionListener<SearchRequest> reque | |||
long took = TimeUnit.NANOSECONDS.toMillis(relativeTimeSupplier.getAsLong() - start); | |||
afterRequestProcessor(processor, took); | |||
onRequestProcessorFailed(processor); | |||
if (processor.isIgnoreFailure()) { | |||
if (processor.isIgnoreFailure() || r.source().verbosePipeline()) { |
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 this extra check for verbosePipeline?
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.
Because when verbosePipeline is enabled, we don't interrupt the search process or immediately return on failure. Instead, we log the failure for the processor and continue executing the rest of the pipeline.
server/src/main/java/org/opensearch/search/pipeline/PipelinedRequest.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/pipeline/SearchPipelineService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/pipeline/SearchPipelineService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/pipeline/ProcessorExecutionDetail.java
Show resolved
Hide resolved
Signed-off-by: Junwei Dai <[email protected]>
Signed-off-by: Junwei Dai <[email protected]>
03b16d5
to
ba933c2
Compare
❌ Gradle check result for ba933c2: 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? |
* | ||
* @opensearch.internal | ||
*/ | ||
@PublicApi(since = "2.19.0") |
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 are we keeping this as public? Also, not matching with the comment on L35
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.
This class is intentionally marked as @publicapi because it is part of the search response and will be exposed to users. I understand the confusion with the comment on L35, and I will revise the comment to make it clearer that this class is indeed a public-facing component. :)
Signed-off-by: Junwei Dai <[email protected]>
Jan 16 revision:
When the verbose pipeline mode is enabled, if a processor encounters an error during execution, the search process will not be interrupted. Instead, the error will be documented in the processor's execution details (e.g., in ProcessorExecutionDetail) and the remaining search process will proceed as normal.
Description
Related RFC : #16705
This PR introduces enhancements to OpenSearch's search pipeline functionality, focusing on improving the traceability and debugging of search request and response transformations. It addresses the increasing complexity of search pipeline processors by implementing verbose mode support, which provides detailed insights into processor execution.
Adds Verbose Mode for Search Pipelines:
verbose_pipeline
parameter to search requests, default to false.Improves Pipeline Debugging:
Supports All Pipeline Configurations:
Test Framework Enhancements:
Example output with request processor:
filter_query
response processor:rename_field
andsort
Related Issues
Resolves #14745
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.