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

Add 'explain' option for cluster reroute command to get details feedback #5012

Closed
dakrone opened this issue Feb 4, 2014 · 1 comment
Closed

Comments

@dakrone
Copy link
Member

dakrone commented Feb 4, 2014

We should add an explain parameter so people can get detailed feedback about why a shard can or cannot be allocated to a node. Something like this:

For these commands:

curl -XPOST 'localhost:9200/_cluster/reroute?explain&pretty' -d '{
  "commands" : [
    {
      "cancel" : {
        "index" : "decide", "shard" : 0, "node": "IvpoKRdtRiGrQ_WKtt4_4w"
      }
    },
    {
      "move" : {
        "index" : "decide", "shard" : 0,
        "from_node" : "IvpoKRdtRiGrQ_WKtt4_4w", "to_node" : "IvpoKRdtRiGrQ_WKtt4_4w"
      }
    }
  ]
}'

This result:

{
  "explanations" : [ {
    "command" : "cancel",
    "parameters" : {
      "index" : "[decide]",
      "shard" : 0,
      "node" : "IvpoKRdtRiGrQ_WKtt4_4w",
      "allow_primary" : false
    },
    "decisions" : [ {
      "decider" : "CancelAllocationCommand",
      "decision" : "NO",
      "explanation" : "can't cancel [decide][0] on node [Wysper][IvpoKRdtRiGrQ_WKtt4_4w][Xanadu.local][inet[/172.16.1.8:9300]], shard is primary and started"
    } ]
  }, {
    "command" : "move",
    "parameters" : {
      "index" : "[decide]",
      "shard" : 0,
      "from_node" : "IvpoKRdtRiGrQ_WKtt4_4w",
      "to_node" : "IvpoKRdtRiGrQ_WKtt4_4w"
    },
    "decisions" : [ {
      "decider" : "SameShard",
      "decision" : "NO",
      "explanation" : "shard cannot be allocated on same node [IvpoKRdtRiGrQ_WKtt4_4w] it already exists on"
    }, {
      "decider" : "Filter",
      "decision" : "YES",
      "explanation" : "node passes include/exclude/require filters"
    }, {
      "decider" : "ReplicaAfterPrimaryActive",
      "decision" : "YES",
      "explanation" : "shard is primary"
    }, {
      "decider" : "Throttling",
      "decision" : "YES",
      "explanation" : "below shard recovery limit of [2]"
    }, {
      "decider" : "Enable",
      "decision" : "YES",
      "explanation" : "allocation disabling is ignored"
    }, {
      "decider" : "Disable",
      "decision" : "YES",
      "explanation" : "allocation disabling is ignored"
    }, {
      "decider" : "Awareness",
      "decision" : "YES",
      "explanation" : "no allocation awareness enabled"
    }, {
      "decider" : "ShardsLimit",
      "decision" : "YES",
      "explanation" : "total shard limit disabled: [-1] <= 0"
    }, {
      "decider" : "NodeVersion",
      "decision" : "YES",
      "explanation" : "target node version [2.0.0-SNAPSHOT] is same or newer than source node version [2.0.0-SNAPSHOT]"
    }, {
      "decider" : "DiskThreshold",
      "decision" : "YES",
      "explanation" : "disk threshold decider disabled"
    }, {
      "decider" : "SnapshotInProgress",
      "decision" : "YES",
      "explanation" : "no snapshots are currently running"
    } ]
  } ]
}
@dakrone
Copy link
Member Author

dakrone commented Feb 4, 2014

Moved to #2483 (closing this as duplicate)

@dakrone dakrone closed this as completed Feb 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant