Skip to content

Return reloaded analyzers in _reload_search_ananlyzer response #43813

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 8 commits into from
Jul 2, 2019

Conversation

cbuescher
Copy link
Member

Currently the repsonse of the "_reload_search_analyzer" endpoint contains the
index names and nodeIds of indices were analyzers reloading was triggered. This
change add the names of the search-time analyzers that were reloaded.

Closes #43804

Currently the repsonse of the "_reload_search_analyzer" endpoint contains the
index names and nodeIds of indices were analyzers reloading was triggered. This
change add the names of the search-time analyzers that were reloaded.

Closes elastic#43804
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

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

The new functionality + tests look good to me. I had a couple comments about the format of the response.

"failed" : 0
},
"reloaded_nodes" : [
Copy link
Contributor

@jtibshirani jtibshirani Jul 1, 2019

Choose a reason for hiding this comment

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

A few thoughts around the structure of this response:

  • I found it a little confusing that this section was named reloaded_nodes, since it's centered around indices instead of nodes (and we call these sections IndexDetails in the Java response). Maybe reloaded_indices would make more sense, or even just indices?
  • When there is one response section per index, we often return a map instead of a list, with the index name as the map key. For example, the 'get index' and 'get mapping' APIs follow this response format.

Copy link
Member Author

@cbuescher cbuescher Jul 1, 2019

Choose a reason for hiding this comment

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

Yes, the format of the response here is a bit different. The reason for this ist that although reloading is centered around indices, it needs to be executed on each node an index shard might live on (and not only once on each shard in a replica set). So this is potentially more than one node per index. While I think the list of nodeIds that were part of reloading for each index is not that important to the average user, it can provide valuable debug information e.g. for UI clients later on.

Regarding your second point: I know we use index names as keys in several places but if not necessary I consciously try to avoid it. I makes parsing of responses more difficult because the parser need to deal with an unbounded set of keys as field names. While we mange to get around it in the places you mentioned, I try to avoid it if possible in order to make the rest response easier to parse.

Copy link
Contributor

Choose a reason for hiding this comment

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

although reloading is centered around indices, it needs to be executed on each node an index shard might live on

That makes sense to me, I was just wondering about the name of the top-level key for the section (currently reloaded_nodes). The name seemed fitting when this section only contained node IDs, but now that it contains analyzer information as well, maybe there could be a better name? In Java this is called reloadedIndicesDetails, so I was bit surprised to see it called reloaded_nodes in the REST response as opposed to something like reloaded_indices.

I know we use index names as keys in several places but if not necessary I consciously try to avoid it.

I agree it makes parsing more difficult! To me it would be best to maintain consistency across APIs (even if it makes parsing a little harder) as opposed to having a mix of styles, since this is least surprising to users. However this may be a bigger conversation, and the API is marked as experimental and can be changed, so it doesn't seem like it should prevent merging.

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 see what you mean now with the top-level key, sorry that I missed that part. Will change to something more neutral and probably also allign the java API to that new key a bit.

@cbuescher
Copy link
Member Author

@jtibshirani thanks for the review, I tried answering your questions around the response format and to explain the decisions involved on my side. Let me know if you have other suggestions for changes.

Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

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

I left a couple responses to your comments. I'll approve since the code looks good and I don't want to hold the PR up too much, but it would be great to take a look at my suggestions to see if you want to incorporate them.

"failed" : 0
},
"reloaded_nodes" : [
Copy link
Contributor

Choose a reason for hiding this comment

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

although reloading is centered around indices, it needs to be executed on each node an index shard might live on

That makes sense to me, I was just wondering about the name of the top-level key for the section (currently reloaded_nodes). The name seemed fitting when this section only contained node IDs, but now that it contains analyzer information as well, maybe there could be a better name? In Java this is called reloadedIndicesDetails, so I was bit surprised to see it called reloaded_nodes in the REST response as opposed to something like reloaded_indices.

I know we use index names as keys in several places but if not necessary I consciously try to avoid it.

I agree it makes parsing more difficult! To me it would be best to maintain consistency across APIs (even if it makes parsing a little harder) as opposed to having a mix of styles, since this is least surprising to users. However this may be a bigger conversation, and the API is marked as experimental and can be changed, so it doesn't seem like it should prevent merging.

@cbuescher
Copy link
Member Author

@jtibshirani sorry I missread your earlier comment about the top-level response key, it probably was a bit later. I changed ""reloaded_nodes" to the more generic "reload_details" because that makes more sense now that there is more information grouped under it. I also changed the Javas API methods to something closer to the rest section (Map<String, ReloadDetails> getReloadDetails()) but I will leave the index names inside this section for now since it might turn into a broader discussion and it got some approvals in the previous reviews of this response already. Will merge and backport this then but please open follow up issues if you think we should discuss the rest more.

Christoph Büscher added 2 commits July 2, 2019 10:39
@cbuescher
Copy link
Member Author

@elasticmachine run elasticsearch-ci/1

@cbuescher
Copy link
Member Author

@elasticmachine run elasticsearch-ci/1

@cbuescher
Copy link
Member Author

@elasticmachine update branch

@cbuescher
Copy link
Member Author

@elasticmachine test this please

@cbuescher cbuescher merged commit 3cc222e into elastic:master Jul 2, 2019
cbuescher pushed a commit that referenced this pull request Jul 2, 2019
Currently the repsonse of the "_reload_search_analyzer" endpoint contains the
index names and nodeIds of indices were analyzers reloading was triggered. This
change add the names of the search-time analyzers that were reloaded.

Closes #43804
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.

Reload analyzers should include analyzer names in response
4 participants