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

Recovery API supports details param not detailed #28910

Closed
javanna opened this issue Mar 6, 2018 · 11 comments · Fixed by #29076
Closed

Recovery API supports details param not detailed #28910

javanna opened this issue Mar 6, 2018 · 11 comments · Fixed by #29076
Labels
>bug :Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. help wanted adoptme

Comments

@javanna
Copy link
Member

javanna commented Mar 6, 2018

As part of #28878 we discovered that the recovery API accepts a detailed parameter, also documented, that is unused. The parameter should rather be called details (see https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/indices/recovery/RecoveryState.java#L918), although it's no longer accepted by the recovery API since we introduced parameters validation. Also the detailed flag is transported to the response, without being serialized nor printed out, where it should be removed.

We should make this work, by either accepting the details param instead and updating docs and spec or modifying RecoveryState to look for detailed instead of details. The detailed flag though doesn't need to be part of the response, and does not need to be part of the request either, given that RestRequest is provided as Params argument to the toXContent method.

@olcbean
Copy link
Contributor

olcbean commented Mar 6, 2018

In a few rest apis detailed flag is used :

boolean detailed = request.paramAsBoolean("detailed", false);

And details is used as a filedname in few responses :


Maybe it would be more consistent to change the details to detailed ?

@hub-cap hub-cap added :Core/Infra/REST API REST infrastructure and utilities and removed :Core/Infra/REST API REST infrastructure and utilities labels Mar 9, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@bleskes bleskes added :Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. and removed :Core/Infra/REST API REST infrastructure and utilities labels Mar 15, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@olcbean
Copy link
Contributor

olcbean commented Mar 27, 2018

We should make this work, by either accepting the details param instead and updating docs and spec or modifying RecoveryState to look for detailed instead of `

I think that it would be better to go the second way : use detailed as a url parameter as done in other requests ( basically go with the documentation - similar to what was done for field_data vs fielddata for clear cache api )

@PnPie @javanna what do you think ?

@javanna
Copy link
Member Author

javanna commented Mar 27, 2018

@olcbean I am not sure, you would go that way because the param was accepted before as detailed although it had no effect? On the other hand it will have some effect now, I wonder if any user ever use that parameter.

@PnPie
Copy link
Contributor

PnPie commented Mar 27, 2018

Yes, and even if there were users using detailed flag before it wouldn't work right ? because in RecoveryState we parsed it as details.

@javanna
Copy link
Member Author

javanna commented Mar 28, 2018

@PnPie one could say there is a subtle difference between not doing anything and throwing error. Probably the latter is better than the former at this point, at least you know that something does not work upfront.

@olcbean
Copy link
Contributor

olcbean commented Mar 28, 2018

Sorry, I think that I was not really clear. Let me try to re-elaborate.

What I meant is that at this case it could be better to go with the documentation and stick with the detailed ( as controversial as it may be, sometimes it could be better to go with the documentation over the concrete implementation ;) )

Without digging too deep, a quick search through the resp-api-spec shows that detailed parameter is used in several apis and details in none.

Maybe making detailed work as expected would be more consistent. Am I missing something ?

@javanna
Copy link
Member Author

javanna commented Mar 28, 2018

thanks for the explanation @olcbean ! I am fine either way, @bleskes you reviewed the PR associated to this issue, do you have an opinion on this?

@PnPie
Copy link
Contributor

PnPie commented Mar 28, 2018

@olcbean Yes, I agree with that (keep it the same as others), and according to all we discussed, I'm more in favor of keeping it as detailed.

@javanna
Copy link
Member Author

javanna commented Mar 5, 2019

agreed @PnPie, I have updated the description of this issue accordingly.

ywelsch pushed a commit that referenced this issue Jun 21, 2019
Properly forwards the `detailed` parameter to show the recovery stats details.

Closes #28910
ywelsch pushed a commit that referenced this issue Jun 21, 2019
Properly forwards the `detailed` parameter to show the recovery stats details.

Closes #28910
jkakavas pushed a commit to jkakavas/elasticsearch that referenced this issue Jun 27, 2019
Properly forwards the `detailed` parameter to show the recovery stats details.

Closes elastic#28910
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. help wanted adoptme
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants