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

Fix multi-search with template doesn't return status code #16265

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

gaobinlong
Copy link
Collaborator

Description

Currently the multi-search API does return the status code in each search response, but multi-search template API does not, these two APIs are very similar, we should make the response consistent, so this PR adds a status code field in each search response for the multi-search template API.

Related Issues

#11133

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

Signed-off-by: Gao Binlong <[email protected]>
Copy link
Contributor

❌ Gradle check result for 8ecb0c9: 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?

@reta
Copy link
Collaborator

reta commented Oct 11, 2024

Thanks @gaobinlong , we would need API changes [1] (and may be documentation updates if we have any) [2].

[1] https://github.com/opensearch-project/opensearch-api-specification
[2] https://github.com/opensearch-project/documentation-website/

@gaobinlong
Copy link
Collaborator Author

Thanks @gaobinlong , we would need API changes [1] (and may be documentation updates if we have any) [2].

[1] https://github.com/opensearch-project/opensearch-api-specification [2] https://github.com/opensearch-project/documentation-website/

Thanks, I've created a document PR:opensearch-project/documentation-website#8522, and for the api-spec repo, I see now the msearch api and msearch template api uses same response schema: MultiSearchResult, so may no need to change it?

@reta
Copy link
Collaborator

reta commented Oct 12, 2024

I see now the msearch api and msearch template api uses same response schema: MultiSearchResult, so may no need to change it?

Thanks @gaobinlong. I just briefly looked at it, seems like MultiSearchResult has no status property? Or I am missing something?

Copy link
Contributor

❌ Gradle check result for 9778ed5: 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?

@gaobinlong
Copy link
Collaborator Author

I see now the msearch api and msearch template api uses same response schema: MultiSearchResult, so may no need to change it?

Thanks @gaobinlong. I just briefly looked at it, seems like MultiSearchResult has no status property? Or I am missing something?

status exists in each search response, the definition is here, the whole response of the API is like this:

{
  "took": 8,
  "responses": [
    {
      "took": 7,
      "timed_out": false,
      "_shards": {...},
      "hits": {...},
      "status": 200
    },
   {
      "took": 7,
      "timed_out": false,
      "_shards": {...},
      "hits": {...},
      "status": 200
    }
  ]
}

@reta
Copy link
Collaborator

reta commented Oct 12, 2024

I see now the msearch api and msearch template api uses same response schema: MultiSearchResult, so may no need to change it?

Thanks @gaobinlong. I just briefly looked at it, seems like MultiSearchResult has no status property? Or I am missing something?

status exists in each search response, the definition is here, the whole response of the API is like this:

{
  "took": 8,
  "responses": [
    {
      "took": 7,
      "timed_out": false,
      "_shards": {...},
      "hits": {...},
      "status": 200
    },
   {
      "took": 7,
      "timed_out": false,
      "_shards": {...},
      "hits": {...},
      "status": 200
    }
  ]
}

Perfrect, thank you!

Copy link
Contributor

❌ Gradle check result for 9778ed5: 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?

@dbwiddis
Copy link
Member

Copy link
Contributor

❌ Gradle check result for 9778ed5: 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?

Copy link
Contributor

✅ Gradle check result for 9778ed5: SUCCESS

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.07%. Comparing base (20536ee) to head (9778ed5).
Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #16265      +/-   ##
============================================
+ Coverage     72.00%   72.07%   +0.06%     
- Complexity    64796    64828      +32     
============================================
  Files          5307     5307              
  Lines        302540   302544       +4     
  Branches      43708    43708              
============================================
+ Hits         217853   218052     +199     
+ Misses        66801    66646     -155     
+ Partials      17886    17846      -40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@reta reta merged commit 55e98ed into opensearch-project:main Oct 14, 2024
37 of 38 checks passed
@reta reta added v3.0.0 Issues and PRs related to version 3.0.0 v2.18.0 Issues and PRs related to version 2.18.0 labels Oct 14, 2024
@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-16265-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 55e98ed2735d898d884295c00f869f5f3278c222
# Push it to GitHub
git push --set-upstream origin backport/backport-16265-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-16265-to-2.x.

@reta
Copy link
Collaborator

reta commented Oct 14, 2024

@gaobinlong could you please backport to 2.x manually? thank you

gaobinlong added a commit to gaobinlong/OpenSearch that referenced this pull request Oct 14, 2024
…-project#16265)

* Fix multi-search with template doesn't return status code

Signed-off-by: Gao Binlong <[email protected]>

* Modify changelog

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
dbwiddis pushed a commit that referenced this pull request Oct 15, 2024
…ode (#16265) (#16312)

* Fix multi-search with template doesn't return status code (#16265)

* Fix multi-search with template doesn't return status code

Signed-off-by: Gao Binlong <[email protected]>

* Modify changelog

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>

* Format the code

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 16, 2024
…-project#16265)

* Fix multi-search with template doesn't return status code

Signed-off-by: Gao Binlong <[email protected]>

* Modify changelog

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 17, 2024
…-project#16265)

* Fix multi-search with template doesn't return status code

Signed-off-by: Gao Binlong <[email protected]>

* Modify changelog

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 21, 2024
…-project#16265)

* Fix multi-search with template doesn't return status code

Signed-off-by: Gao Binlong <[email protected]>

* Modify changelog

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
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 v2.18.0 Issues and PRs related to version 2.18.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants