Skip to content

Remove the deprecated local parameter for _cat/shards#64867

Merged
danhermann merged 3 commits intoelastic:masterfrom
danhermann:remove_local_for_cat_shards
Nov 13, 2020
Merged

Remove the deprecated local parameter for _cat/shards#64867
danhermann merged 3 commits intoelastic:masterfrom
danhermann:remove_local_for_cat_shards

Conversation

@danhermann
Copy link
Copy Markdown
Contributor

@danhermann danhermann commented Nov 10, 2020

The cat shards API performs a ClusterStateAction and then an IndicesStatsAction. Today it accepts the ?local parameter and passes this to the ClusterStateAction but this parameter has no effect on the IndicesStatsAction. This can be surprising because GET _cat/shards?local looks like it might be a completely local call but in fact it still depends on every node in the cluster.

The local parameter was deprecated in 7.x (#62197) and this commit removes it for 8.x.

@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-features (:Core/Features/CAT APIs)

@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Nov 10, 2020
Copy link
Copy Markdown
Member

@dakrone dakrone 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 comment related to this

Comment on lines +92 to +93
if (request.hasParam("local") && Version.CURRENT.major == Version.V_7_0_0.major + 1) {
throw new IllegalArgumentException("parameter [local] is not supported");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You don't need to add this I believe, we automatically throw exceptions on unrecognized parameters:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "request [/_cat/shards] contains unrecognized parameter: [aoeu]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "request [/_cat/shards] contains unrecognized parameter: [aoeu]"
  },
  "status" : 400
}

@danhermann
Copy link
Copy Markdown
Contributor Author

@elasticmachine update branch

Copy link
Copy Markdown
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM

@danhermann
Copy link
Copy Markdown
Contributor Author

Thanks, @dakrone!

@danhermann danhermann merged commit f63a3b5 into elastic:master Nov 13, 2020
@danhermann danhermann deleted the remove_local_for_cat_shards branch November 13, 2020 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>breaking :Core/Infra/CAT APIs Text APIs behind /_cat Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants