Skip to content
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

Make search pipelines asynchronous #10598

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

msfroh
Copy link
Collaborator

@msfroh msfroh commented Oct 12, 2023

Description

If a search processor needs to make a call out to another service, we should not risk blocking on the transport thread. We should support async execution.

Related Issues

Resolves #10248

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

@github-actions github-actions bot added bug Something isn't working Search Search query, autocomplete ...etc labels Oct 12, 2023
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT:
  • URL:
  • CommitID: f44e521
    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?

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT:
  • URL:
  • CommitID: 1e63756
    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?

@github-actions
Copy link
Contributor

github-actions bot commented Oct 12, 2023

Compatibility status:

Checks if related components are compatible with change 70567bd

Incompatible components

Incompatible components: [https://github.com/opensearch-project/performance-analyzer.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git]

@msfroh msfroh force-pushed the async_search_pipelines branch 2 times, most recently from 07aa11e to 526493e Compare October 12, 2023 23:38
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #10598 (70567bd) into main (be65f54) will increase coverage by 0.03%.
Report is 4 commits behind head on main.
The diff coverage is 93.33%.

@@             Coverage Diff              @@
##               main   #10598      +/-   ##
============================================
+ Coverage     71.21%   71.25%   +0.03%     
- Complexity    58689    58767      +78     
============================================
  Files          4870     4872       +2     
  Lines        276539   276594      +55     
  Branches      40190    40189       -1     
============================================
+ Hits         196945   197092     +147     
+ Misses        63192    63096      -96     
- Partials      16402    16406       +4     
Files Coverage Δ
...g/opensearch/search/pipeline/PipelinedRequest.java 100.00% <100.00%> (ø)
...nsearch/search/pipeline/SearchPipelineService.java 85.51% <100.00%> (-0.07%) ⬇️
...search/search/pipeline/SearchRequestProcessor.java 100.00% <100.00%> (ø)
...earch/search/pipeline/SearchResponseProcessor.java 100.00% <100.00%> (ø)
.../java/org/opensearch/search/pipeline/Pipeline.java 85.81% <96.62%> (+2.98%) ⬆️
...pensearch/action/search/TransportSearchAction.java 67.69% <70.58%> (+1.08%) ⬆️

... and 460 files with indirect coverage changes

@harshavamsi
Copy link
Contributor

@reta can you take a look and approve if this looks good?

@reta
Copy link
Collaborator

reta commented Oct 26, 2023

@reta can you take a look and approve if this looks good?

@harshavamsi there comments we agreed to address but they aren't

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@msfroh
Copy link
Collaborator Author

msfroh commented Oct 27, 2023

@reta can you take a look and approve if this looks good?

@harshavamsi there comments we agreed to address but they aren't

Oh -- yeah, sorry. I got sidetracked with some other stuff. I didn't consider this one ready to merge yet. I'll let y'all know once I've addressed the outstanding issues.

If a search processor needs to make a call out to another
service, we should not risk blocking on the transport thread. We should
support async execution.

Signed-off-by: Michael Froh <froh@amazon.com>
Also, IntelliJ suggested refactoring creation of the terminal request
callback into a separate method since the existing method was really
big. I liked that suggestion.

Signed-off-by: Michael Froh <froh@amazon.com>
Signed-off-by: Michael Froh <froh@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@msfroh msfroh added the backport 2.x Backport to 2.x branch label Oct 30, 2023
@msfroh msfroh merged commit da011ba into opensearch-project:main Oct 30, 2023
20 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-10598-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 da011ba7ec35770bf4aabf1d26f8e257946fc28f
# Push it to GitHub
git push --set-upstream origin backport/backport-10598-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-10598-to-2.x.

msfroh added a commit to msfroh/OpenSearch that referenced this pull request Oct 30, 2023
* Make search pipelines asynchronous

If a search processor needs to make a call out to another
service, we should not risk blocking on the transport thread. We should
support async execution.

Signed-off-by: Michael Froh <froh@amazon.com>

* Compute pipelineStart before building request callback chain

Also, IntelliJ suggested refactoring creation of the terminal request
callback into a separate method since the existing method was really
big. I liked that suggestion.

Signed-off-by: Michael Froh <froh@amazon.com>

* Rename async methods (put async at end)

Signed-off-by: Michael Froh <froh@amazon.com>

---------

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit da011ba)
reta pushed a commit that referenced this pull request Oct 31, 2023
* Make search pipelines asynchronous

If a search processor needs to make a call out to another
service, we should not risk blocking on the transport thread. We should
support async execution.

Signed-off-by: Michael Froh <froh@amazon.com>

* Compute pipelineStart before building request callback chain

Also, IntelliJ suggested refactoring creation of the terminal request
callback into a separate method since the existing method was really
big. I liked that suggestion.

Signed-off-by: Michael Froh <froh@amazon.com>

* Rename async methods (put async at end)

Signed-off-by: Michael Froh <froh@amazon.com>

---------

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit da011ba)
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
* Make search pipelines asynchronous

If a search processor needs to make a call out to another
service, we should not risk blocking on the transport thread. We should
support async execution.

Signed-off-by: Michael Froh <froh@amazon.com>

* Compute pipelineStart before building request callback chain

Also, IntelliJ suggested refactoring creation of the terminal request
callback into a separate method since the existing method was really
big. I liked that suggestion.

Signed-off-by: Michael Froh <froh@amazon.com>

* Rename async methods (put async at end)

Signed-off-by: Michael Froh <froh@amazon.com>

---------

Signed-off-by: Michael Froh <froh@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport-failed bug Something isn't working Search:Relevance Search Search query, autocomplete ...etc
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] Search pipeline seen executing on transport_worker thread
5 participants