Skip to content

Fix search_shards API #2834

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

Merged
merged 2 commits into from
Sep 2, 2024
Merged

Fix search_shards API #2834

merged 2 commits into from
Sep 2, 2024

Conversation

pquentin
Copy link
Member

No description provided.

Comment on lines 58 to 61
// version, min_index_version and max_index_version are set when using the search_shards API
version?: VersionString
min_index_version?: integer
max_index_version?: integer
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hesitated a lot on this one. NodeAttributes is used by transform.get_transform_stats, cat.ml_data_frame_analytics, and cat.nodeattrs, but they're much ligther versions, which is why many fields are optional. At this point I think it would be better to have a specific NodeAttributes just for search_shards, which would remove a lot of optional keys. But I'm not sure about the impact on typed clients.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both solutions should be fine. It might as well be worth to consider which solution better reflects the server code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's definitely the second one. I'll update my pull request then, thanks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 08babed (#2834). Our tooling forced me to use a different class name.

I hope this won't be breaking any clients.

Copy link
Contributor

github-actions bot commented Sep 2, 2024

Following you can find the validation results for the API you have changed.

API Status Request Response
search_shards 🟢 7/7 7/7

You can validate this API yourself by using the make validate target.

@pquentin pquentin merged commit 72b6781 into main Sep 2, 2024
6 checks passed
@pquentin pquentin deleted the fix-search-shards-response branch September 2, 2024 17:08
Copy link
Contributor

github-actions bot commented Sep 2, 2024

The backport to 8.15 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.15 8.15
# Navigate to the new working tree
cd .worktrees/backport-8.15
# Create a new branch
git switch --create backport-2834-to-8.15
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 72b6781a56ff0ffc93c5949c6327e550180ce721
# Push it to GitHub
git push --set-upstream origin backport-2834-to-8.15
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.15

Then, create a pull request where the base branch is 8.15 and the compare/head branch is backport-2834-to-8.15.

pquentin added a commit that referenced this pull request Sep 2, 2024
* Fix search_shards API

* Use a specialized version of NodeAttributes for search_shards

(cherry picked from commit 72b6781)
pquentin added a commit that referenced this pull request Sep 2, 2024
* Fix search_shards API

* Use a specialized version of NodeAttributes for search_shards

(cherry picked from commit 72b6781)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants